Skip to content

Commit e767725

Browse files
committed
Add NodeJS_INSTALL_PREFIX for FindNodeJS.cmake.
1 parent 4a29ac2 commit e767725

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmake/FindNodeJS.cmake

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#
3030
# NodeJS_CMAKE_DEBUG - Print paths for debugging
3131
# NodeJS_EXECUTABLE_ONLY - Find only NodeJS executable (avoid library and include files)
32+
# NodeJS_SHARED_UV - If it is enabled, libuv won't be required by this script
33+
# NodeJS_BUILD_FROM_SOURCE - If it is enabled, NodeJS runtime library will be built from source
34+
# NodeJS_INSTALL_PREFIX - Define a custom install prefix for NodeJS (Linux / Darwin only)
3235

3336
# Prevent vervosity if already included
3437
if(NodeJS_EXECUTABLE)
@@ -474,7 +477,13 @@ if(NOT NodeJS_LIBRARY)
474477
set(ICU_ENV_VAR)
475478
endif()
476479

477-
execute_process(COMMAND ${ICU_ENV_VAR} sh -c "./configure --with-icu-source=${ICU_URL} --shared ${ICU_DEBUG}" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}")
480+
if(NodeJS_INSTALL_PREFIX)
481+
set(NodeJS_PREFIX "--prefix=${NodeJS_INSTALL_PREFIX}")
482+
else()
483+
set(NodeJS_PREFIX)
484+
endif()
485+
486+
execute_process(COMMAND ${ICU_ENV_VAR} sh -c "./configure ${NodeJS_PREFIX} --with-icu-source=${ICU_URL} --shared ${ICU_DEBUG}" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}")
478487

479488
message(STATUS "Build NodeJS shared library")
480489

0 commit comments

Comments
 (0)