summaryrefslogtreecommitdiff
path: root/cmake/mbgl.cmake
diff options
context:
space:
mode:
authorJesse Crocker <jesse@gaiagps.com>2017-03-01 11:15:11 -0700
committerJesse Crocker <jesse@gaiagps.com>2017-03-01 11:15:11 -0700
commit9e8dc9a9e3e86adb9987ae69766cc42c7d9efece (patch)
treef5f0abd4d342c89ad0405d01969f9d6caecc1c90 /cmake/mbgl.cmake
parent16fb0672e64a72b7400c321d55858b73cd5d8c3f (diff)
parentf28d75dccd9bf4a7615df87faccc5cf5eff8df89 (diff)
downloadqtlocation-mapboxgl-9e8dc9a9e3e86adb9987ae69766cc42c7d9efece.tar.gz
Merge remote-tracking branch 'origin/master' into feature/custom-vector-source
Diffstat (limited to 'cmake/mbgl.cmake')
-rw-r--r--cmake/mbgl.cmake29
1 files changed, 7 insertions, 22 deletions
diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake
index 4002257bb4..8c9aa0fe8f 100644
--- a/cmake/mbgl.cmake
+++ b/cmake/mbgl.cmake
@@ -6,27 +6,12 @@ if (NOT MBGL_PLATFORM)
endif()
endif()
-if (NOT MASON_PLATFORM)
- set(MASON_PLATFORM "${MBGL_PLATFORM}")
+find_program(NodeJS_EXECUTABLE NAMES nodejs node)
+if (NOT NodeJS_EXECUTABLE)
+ message(FATAL_ERROR "Could not find Node.js")
endif()
-set(MBGL_GENERATED ${CMAKE_BINARY_DIR}/generated/${CMAKE_CFG_INTDIR})
-
-if(NOT EXISTS ${CMAKE_SOURCE_DIR}/node_modules/node-cmake/FindNodeJS.cmake)
- message(FATAL_ERROR "Can't find node-cmake")
-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()
@@ -56,7 +41,7 @@ endfunction()
# Run submodule update
message(STATUS "Updating submodules...")
execute_process(
- COMMAND git submodule update --init .mason mapbox-gl-js
+ COMMAND git submodule update --init mapbox-gl-js
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/mapbox-gl-js/node_modules")
@@ -70,14 +55,14 @@ endif()
# Add target for running submodule update during builds
add_custom_target(
update-submodules ALL
- COMMAND git submodule update --init .mason mapbox-gl-js
+ COMMAND git submodule update --init mapbox-gl-js
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMENT "Updating submodules..."
)
# Run npm install for both directories, and add custom commands, and a target that depends on them.
_npm_install("${CMAKE_SOURCE_DIR}" mapbox-gl-native update-submodules)
-_npm_install("${CMAKE_SOURCE_DIR}/mapbox-gl-js" mapbox-gl-js "${CMAKE_SOURCE_DIR}/node_modules/.mapbox-gl-native.stamp")
+_npm_install("${CMAKE_SOURCE_DIR}/mapbox-gl-js/test/integration" mapbox-gl-js "${CMAKE_SOURCE_DIR}/node_modules/.mapbox-gl-native.stamp")
add_custom_target(
npm-install ALL
DEPENDS "${CMAKE_SOURCE_DIR}/node_modules/.mapbox-gl-js.stamp"