mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
cmake - support find_package for json
This commit is contained in:
+20
-9
@@ -251,15 +251,26 @@ endif()
|
|||||||
|
|
||||||
if(GLTF_SUPPORT OR CITYJSON_SUPPORT)
|
if(GLTF_SUPPORT OR CITYJSON_SUPPORT)
|
||||||
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
|
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
|
||||||
clear_wasm_sysroot()
|
if(NOT JSON_INCLUDE_DIR)
|
||||||
find_path(json_header_path "nlohmann/json.hpp" HINTS ${JSON_INCLUDE_DIR})
|
find_package(nlohmann_json CONFIG)
|
||||||
restore_wasm_sysroot()
|
if(nlohmann_json_DIR)
|
||||||
set(JSON_INCLUDE_DIR ${json_header_path})
|
link_libraries(nlohmann_json::nlohmann_json)
|
||||||
|
else()
|
||||||
if(json_header_path)
|
message(STATUS "Unable to find nlohmann_json package, trying to find it as a header-only library.")
|
||||||
message(STATUS "JSON for Modern C++ header file found in ${JSON_INCLUDE_DIR}")
|
endif()
|
||||||
else()
|
endif()
|
||||||
message(FATAL_ERROR "Unable to find JSON for Modern C++ header file, aborting")
|
|
||||||
|
if(NOT nlohmann_json_DIR)
|
||||||
|
clear_wasm_sysroot()
|
||||||
|
find_path(json_header_path "nlohmann/json.hpp" HINTS ${JSON_INCLUDE_DIR})
|
||||||
|
restore_wasm_sysroot()
|
||||||
|
set(JSON_INCLUDE_DIR ${json_header_path})
|
||||||
|
|
||||||
|
if(json_header_path)
|
||||||
|
message(STATUS "JSON for Modern C++ header file found in '${JSON_INCLUDE_DIR}'.")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unable to find JSON for Modern C++ header file / package, aborting")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DWITH_GLTF)
|
add_definitions(-DWITH_GLTF)
|
||||||
|
|||||||
Reference in New Issue
Block a user