Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 5, 2024
1 parent fb04351 commit 7ab92b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
42 changes: 18 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cmake-js",
"name": "cmake-js2",
"description": "CMake.js - a Node.js native addon build tool",
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -67,30 +67,24 @@
"scripts": {
"test": "mocha tests",
"lint": "eslint lib bin/cmake-js tests",

"demo": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE && cmake --build ./build && cmake --install ./build --prefix ./install && ctest --test-dir ./build --rerun-failed --output-on-failure --verbose && cpack -B ./install --config ./build/CPackConfig.cmake && cpack -B ./install --config ./build/CPackSourceConfig.cmake",

"configure": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"reconfigure": "cmake --fresh -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"build": "cmake --build ./build",
"rebuild": "cmake --fresh -S . -B ./build && cmake --build ./build",


"cmake:configure": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"demo": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE && cmake --build ./build && cmake --install ./build --prefix ./install && ctest --test-dir ./build --rerun-failed --output-on-failure --verbose && cpack -B ./install --config ./build/CPackConfig.cmake && cpack -B ./install --config ./build/CPackSourceConfig.cmake",
"configure": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"reconfigure": "cmake --fresh -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"build": "cmake --build ./build",
"rebuild": "cmake --fresh -S . -B ./build && cmake --build ./build",
"cmake:configure": "cmake -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"cmake:reconfigure": "cmake --fresh -S . -B ./build -DBUILD_TESTS:BOOL=TRUE",
"cmake:build": "cmake --build ./build",
"cmake:rebuild": "cmake --fresh -S . -B ./build && cmake --build ./build",
"cmake:install": "cmake --install ./build --prefix ./install",
"cmake:help": "cmake --help",

"ctest": "ctest --test-dir ./build --rerun-failed --output-on-failure --verbose",
"ctest:help": "ctest --help",

"cpack:all": "cpack -B ./build --config ./build/CPackConfig.cmake",
"cpack:zip": "cpack -B ./build --config ./build/CPackConfig.cmake --generator ZIP",
"cpack:tar": "cpack -B ./build --config ./build/CPackConfig.cmake --generator TAR",
"cpack:source": "cpack -B ./build --config ./build/CPackSourceConfig.cmake",
"cpack:help": "cpack --help"
"cmake:build": "cmake --build ./build",
"cmake:rebuild": "cmake --fresh -S . -B ./build && cmake --build ./build",
"cmake:install": "cmake --install ./build --prefix ./install",
"cmake:help": "cmake --help",
"ctest": "ctest --test-dir ./build --rerun-failed --output-on-failure --verbose",
"ctest:help": "ctest --help",
"cpack:all": "cpack -B ./build --config ./build/CPackConfig.cmake",
"cpack:zip": "cpack -B ./build --config ./build/CPackConfig.cmake --generator ZIP",
"cpack:tar": "cpack -B ./build --config ./build/CPackConfig.cmake --generator TAR",
"cpack:source": "cpack -B ./build --config ./build/CPackSourceConfig.cmake",
"cpack:help": "cpack --help"
},
"files": [
"lib",
Expand Down
5 changes: 2 additions & 3 deletions share/cmake/CMakeJS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function(cmakejs_acquire_napi_c_files)
)
string(REGEX REPLACE "[\r\n\"]" "" NODE_API_HEADERS_DIR "${NODE_API_HEADERS_DIR}")

# relocate...
# copy the headers to mitigate `Target "node-api-headers" INTERFACE_INCLUDE_DIRECTORIES property contains path which is prefixed in the source directory.`
file(GLOB _NODE_API_INC_FILES "${NODE_API_HEADERS_DIR}/*.h")
file(COPY ${_NODE_API_INC_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/node-api-headers")
unset(_NODE_API_INC_FILES)
Expand Down Expand Up @@ -195,7 +195,7 @@ function(cmakejs_acquire_napi_cpp_files)
)
string(REGEX REPLACE "[\r\n\"]" "" NODE_ADDON_API_DIR "${NODE_ADDON_API_DIR}")

# relocate...
# copy the headers to mitigate `Target "node-addon-api" INTERFACE_INCLUDE_DIRECTORIES property contains path which is prefixed in the source directory.`
file(GLOB _NODE_ADDON_API_INC_FILES "${NODE_ADDON_API_DIR}/*.h")
file(COPY ${_NODE_ADDON_API_INC_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/node-addon-api")
unset(_NODE_ADDON_API_INC_FILES)
Expand Down Expand Up @@ -283,7 +283,6 @@ if(CMAKEJS_NODE_API)
endif()

if(CMAKEJS_NODE_ADDON_API)

# Acquire if needed...
if(NOT DEFINED NODE_ADDON_API_DIR)
cmakejs_acquire_napi_cpp_files()
Expand Down

0 comments on commit 7ab92b1

Please sign in to comment.