From 4d90d34f728f0ca130e61da5bad3556107a56776 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 31 Jan 2024 22:31:07 +0100 Subject: [PATCH] Move install step of nodejs built from source from cmake script to node loader install phase. --- cmake/FindNodeJS.cmake | 8 ++------ source/loaders/node_loader/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index 2bfa9af6e..8ff2210fd 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -490,8 +490,6 @@ if(NOT NodeJS_LIBRARY) # Copy library to MetaCall output path execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}) file(COPY "${NodeJS_COMPILE_PATH}/${NodeJS_LIBRARY_NAME}" DESTINATION ${PROJECT_OUTPUT_DIR}) - - message(STATUS "Install NodeJS shared library") endif() else() message(STATUS "Configure NodeJS shared library") @@ -553,10 +551,6 @@ if(NOT NodeJS_LIBRARY) else() execute_process(COMMAND sh -c "make -C out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}") endif() - - message(STATUS "Install NodeJS shared library") - - execute_process(COMMAND sh -c "make install" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}") endif() endif() @@ -576,6 +570,8 @@ if(NOT NodeJS_LIBRARY) if(NOT NodeJS_LIBRARY) message(FATAL_ERROR "NodeJS library not found and it could not be built from source") + else() + set(NodeJS_BUILD_FROM_SOURCE TRUE) endif() endif() diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 7d887d5d0..814f411f7 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -234,4 +234,10 @@ if(NodeJS_LIBRARY_NAME_PATH AND WIN32) DESTINATION ${INSTALL_LIB} COMPONENT runtime ) +elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32) + install(FILES + "${NodeJS_LIBRARY}" + DESTINATION ${INSTALL_LIB} + COMPONENT runtime + ) endif()