-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Use ExternalProject for Cesium
- Loading branch information
1 parent
41c4feb
commit d51500c
Showing
8 changed files
with
71 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
cmake --build build -- -j | ||
cmake --build --preset conan-release -- -j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
include(FetchContent) | ||
include(ExternalProject) | ||
|
||
# Use fetch content for cloning the repository durring | ||
# configure phase. We do not call `FetchContent_MakeAvailable`, | ||
# but instead use `ExternalProject_Add` to compile Cesium in | ||
# isolation. | ||
FetchContent_Declare(cesiumnative_src | ||
GIT_REPOSITORY "https://github.com/Klebert-Engineering/cesium-native.git" | ||
GIT_TAG "main" | ||
GIT_SUBMODULES_RECURSE YES | ||
GIT_PROGRESS YES) | ||
|
||
FetchContent_GetProperties(cesiumnative_src) | ||
if (NOT cesiumnative_src_POPULATED) | ||
FetchContent_Populate(cesiumnative_src) | ||
endif() | ||
|
||
ExternalProject_Add(cesiumnative | ||
SOURCE_DIR ${cesiumnative_src_SOURCE_DIR} | ||
CMAKE_ARGS | ||
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | ||
-DCESIUM_TESTS_ENABLED=OFF | ||
-DCESIUM_GLM_STRICT_ENABLED=OFF | ||
-DCESIUM_TRACING_ENABLED=OFF | ||
-DDRACO_JS_GLUE=OFF | ||
#-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} # FIXME: Is this needed? | ||
INSTALL_COMMAND "") | ||
|
||
function (add_cesium_lib TARGET) | ||
message(STATUS "Adding Cesium library: ${TARGET}") | ||
ExternalProject_Get_Property(cesiumnative | ||
SOURCE_DIR BINARY_DIR) | ||
|
||
add_library(${TARGET} SHARED IMPORTED) | ||
set_target_properties(${TARGET} PROPERTIES | ||
IMPORTED_LOCATION "${BINARY_DIR}/${TARGET}/${CMAKE_STATIC_LIBRARY_PREFIX}${TARGET}${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/${TARGET}/include") | ||
endfunction() | ||
|
||
add_cesium_lib(CesiumUtility) | ||
add_cesium_lib(Cesium3DTilesWriter) | ||
add_cesium_lib(CesiumGeospatial) | ||
add_cesium_lib(CesiumGltf) | ||
add_cesium_lib(CesiumGltfWriter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
[requires] | ||
mapget/dev | ||
glm/cci.20230113 | ||
yaml-cpp/0.8.0 | ||
|
||
[options] | ||
mapget/*:with_service=False | ||
|
||
[generators] | ||
CMakeDeps | ||
CMakeToolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters