From 3ba6ad1f66a2db7dd1beaec33e3bc5deec409d11 Mon Sep 17 00:00:00 2001 From: Asi Bross Date: Mon, 26 Jun 2017 16:05:05 -0700 Subject: [PATCH] Find path to boost-lib cmake file --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 712df44..e8f0dc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,12 @@ set(Boost_USE_STATIC_RUNTIME OFF) if (CMAKE_JS_VERSION) # Include BoostLib module - LIST(APPEND CMAKE_MODULE_PATH - "${PROJECT_SOURCE_DIR}/node_modules/boost-lib/cmake" - "${PROJECT_SOURCE_DIR}/../boost-lib/cmake") - + execute_process(COMMAND npm config get prefix RESULT_VARIABLE ERR OUTPUT_VARIABLE NPM_GLOBAL_PATH) + if(ERR) + message(FATAL_ERROR "Failed to get npm global installation path.") + endif(ERR) + set(CMAKE_MODULE_PATH "${NPM_GLOBAL_PATH}/node_modules/boost-lib/cmake") + include(BoostLib) require_boost_libs(">= 1.62.0" "${REQUIRED_BOOST_COMPONENTS}")