From 5b24b1474187807b46de2e4c4fb587bcdee4d1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 21 Feb 2017 18:32:53 +0100 Subject: [build] use node-cmake 2.x - Removes need to run `npm install` before invoking cmake --- cmake/mbgl.cmake | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'cmake/mbgl.cmake') diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake index 41d820a077..8c9aa0fe8f 100644 --- a/cmake/mbgl.cmake +++ b/cmake/mbgl.cmake @@ -6,21 +6,12 @@ if (NOT MBGL_PLATFORM) endif() endif() -if(NOT EXISTS ${CMAKE_SOURCE_DIR}/node_modules/node-cmake/FindNodeJS.cmake) - message(FATAL_ERROR "Can't find node-cmake") +find_program(NodeJS_EXECUTABLE NAMES nodejs node) +if (NOT NodeJS_EXECUTABLE) + message(FATAL_ERROR "Could not find Node.js") endif() -# Load Node.js -set(NodeJS_CXX_STANDARD 14 CACHE INTERNAL "Use C++14" FORCE) -set(NodeJS_DOWNLOAD ON CACHE INTERNAL "Download node.js sources" FORCE) -set(NodeJS_USE_CLANG_STDLIB OFF CACHE BOOL "Don't use libc++ by default" FORCE) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/node_modules/node-cmake) -find_package(NodeJS) - -find_program(npm_EXECUTABLE - NAMES npm - PATHS ${NodeJS_ROOT_DIR}) - +find_program(npm_EXECUTABLE NAMES npm) if (NOT npm_EXECUTABLE) message(FATAL_ERROR "Could not find npm") endif() -- cgit v1.2.1