Trying to solve bootstrap with two targets and depends now.
@@ -51,6 +51,16 @@ if(NOT OPTION_BUILD_GUIX)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib
COMMAND ${CMAKE_COMMAND} -E echo "Installing ${target} dependencies"
COMMAND ${NPM_EXECUTABLE} install
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/package.json ${CMAKE_CURRENT_SOURCE_DIR}/lib/package-lock.json
+ )
+
+ set_target_properties(${target}_depends
+ PROPERTIES
+ ${DEFAULT_PROJECT_OPTIONS}
+ FOLDER "${IDE_FOLDER}"
+ )
+
+ add_custom_target(${target}_copy_depends
COMMAND ${CMAKE_COMMAND} -E echo "Copying ${target} dependencies"
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}/node_modules
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/lib/node_modules/ ${PROJECT_OUTPUT_DIR}/node_modules
@@ -58,13 +68,14 @@ if(NOT OPTION_BUILD_GUIX)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/package.json ${CMAKE_CURRENT_SOURCE_DIR}/lib/package-lock.json
)
- set_target_properties(${target}_depends
+ set_target_properties(${target}_copy_depends
PROPERTIES
${DEFAULT_PROJECT_OPTIONS}
FOLDER "${IDE_FOLDER}"
)
- add_dependencies(${target} ${target}_depends)
+ add_dependencies(${target}_copy_depends ${target}_depends)
+ add_dependencies(${target} ${target}_depends ${target}_copy_depends)
install(DIRECTORY
${PROJECT_OUTPUT_DIR}/node_modules/espree
