diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 382e7396b4..60294c2256 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -221,10 +221,11 @@ endif() if(GLTF_SUPPORT OR CITYJSON_SUPPORT) UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR) - find_file(json_hpp "json.hpp" ${JSON_INCLUDE_DIR}/nlohmann) + find_path(json_header_path "json.hpp" ${JSON_INCLUDE_DIR} PATH_SUFFIXES "nlohmann") + set(JSON_INCLUDE_DIR ${json_header_path}) - if(json_hpp) - message(STATUS "JSON for Modern C++ header file found") + 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, aborting") endif()