diff --git a/CMakeLists.txt b/CMakeLists.txt index f59c90aae..8ba6713ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,26 +295,26 @@ list(APPEND CMAKE_PREFIX_PATH "${PACKAGE_BUILD_DIR}") # they won't be visible in this scope nor any of the subdirectories for the actual libraries. # # However, for some of the vcpkg built libraries where they don't provide a prope cmake config file, we have to declare -# and imporeted library target ourselves. This is the case for modp_b64::modp_b64, picosha2::picosha2 and earcut. In +# an imported library target ourselves. This is the case for modp_b64::modp_b64, picosha2::picosha2 and earcut. In # these cases, we *do* have the somewhat ugly and verbose details in the extern/CMakeLists.txt file. # # XXX Above comment should be obsoleted by these first calls to # find_package, which resolve to our own modules that provide # targets. If needed, they can be installed with CMake config files # etc. -find_package(zlib-ng REQUIRED) find_package(modp_b64 REQUIRED) find_package(ada CONFIG REQUIRED) find_package(Async++ CONFIG REQUIRED) +find_package(blend2d CONFIG REQUIRED) find_package(doctest CONFIG REQUIRED) find_package(draco CONFIG REQUIRED) find_package(expected-lite CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) find_package(httplib CONFIG REQUIRED) find_package(Ktx CONFIG REQUIRED) -find_package(libmorton CONFIG REQUIRED) find_package(libjpeg-turbo CONFIG REQUIRED) +find_package(libmorton CONFIG REQUIRED) find_package(meshoptimizer CONFIG REQUIRED) find_package(OpenSSL REQUIRED) find_package(s2 CONFIG REQUIRED) @@ -322,17 +322,13 @@ find_package(spdlog CONFIG REQUIRED) find_package(tinyxml2 CONFIG REQUIRED) find_package(unofficial-sqlite3 CONFIG REQUIRED) find_package(WebP CONFIG REQUIRED) -find_package(blend2d CONFIG REQUIRED) +find_package(zlib-ng CONFIG REQUIRED) + # asmjit should not be included with iOS builds as iOS doesn't support JIT compilation. if(NOT IOS AND NOT VCPKG_CMAKE_SYSTEM_NAME MATCHES "iOS") find_package(asmjit CONFIG REQUIRED) endif() -if(NOT CESIUM_DISABLE_CURL) - find_package(CURL REQUIRED) -endif() - - if(NOT CESIUM_DISABLE_CURL) find_package(CURL REQUIRED) endif() @@ -386,7 +382,6 @@ if(CESIUM_INSTALL_STATIC_LIBS AND CESIUM_INSTALL_HEADERS) DESTINATION ${CMAKE_INSTALL_DATADIR}/cesium-native/cmake) install(FILES - "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/Findzlib-ng.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/Findmodp_b64.cmake" DESTINATION ${CMAKE_INSTALL_DATADIR}/cesium-native/cmake) diff --git a/CesiumUtility/CMakeLists.txt b/CesiumUtility/CMakeLists.txt index bfa235ed7..93064da3c 100644 --- a/CesiumUtility/CMakeLists.txt +++ b/CesiumUtility/CMakeLists.txt @@ -41,7 +41,7 @@ cesium_target_include_directories( target_link_libraries( CesiumUtility PUBLIC - zlib-ng::zlib-ng + zlib-ng::zlib spdlog::spdlog glm::glm ada::ada diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in index bdde0633e..8bcd37d27 100644 --- a/cmake/config/Config.cmake.in +++ b/cmake/config/Config.cmake.in @@ -4,25 +4,35 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") include(CMakeFindDependencyMacro) -find_dependency(zlib-ng REQUIRED) find_dependency(modp_b64 REQUIRED) +find_dependency(ada CONFIG REQUIRED) find_dependency(Async++ CONFIG REQUIRED) +find_dependency(blend2d CONFIG REQUIRED) find_dependency(doctest CONFIG REQUIRED) find_dependency(draco CONFIG REQUIRED) find_dependency(expected-lite CONFIG REQUIRED) find_dependency(glm CONFIG REQUIRED) -find_dependency(meshoptimizer CONFIG REQUIRED) find_dependency(httplib CONFIG REQUIRED) find_dependency(Ktx CONFIG REQUIRED) -find_dependency(libmorton CONFIG REQUIRED) find_dependency(libjpeg-turbo CONFIG REQUIRED) +find_dependency(libmorton CONFIG REQUIRED) +find_dependency(meshoptimizer CONFIG REQUIRED) find_dependency(OpenSSL REQUIRED) find_dependency(s2 CONFIG REQUIRED) find_dependency(spdlog CONFIG REQUIRED) find_dependency(tinyxml2 CONFIG REQUIRED) find_dependency(unofficial-sqlite3 CONFIG REQUIRED) -find_dependency(ada CONFIG REQUIRED) find_dependency(WebP CONFIG REQUIRED) +find_dependency(zlib-ng CONFIG REQUIRED) + +# asmjit should not be included with iOS builds as iOS doesn't support JIT compilation. +if(NOT IOS AND NOT VCPKG_CMAKE_SYSTEM_NAME MATCHES "iOS") + find_dependency(asmjit CONFIG REQUIRED) +endif() + +if(NOT CESIUM_DISABLE_CURL) + find_dependency(CURL REQUIRED) +endif() include("${CMAKE_CURRENT_LIST_DIR}/cesium-nativeTargets.cmake") diff --git a/cmake/modules/Findzlib-ng.cmake b/cmake/modules/Findzlib-ng.cmake deleted file mode 100644 index ed291c19d..000000000 --- a/cmake/modules/Findzlib-ng.cmake +++ /dev/null @@ -1,46 +0,0 @@ - -find_library(zlib-ng_LIBRARIES NAMES zlibstatic-ng z-ng zlib-ng) -find_library(zlib-ng_DEBUG_LIBRARIES - NAMES - "zlibstatic-ngd" - "z-ngd" - "zlib-ngd" - ) - -# vcpkg specific locations for debug libraries if they are not already found -set(zlibngSavePrefixPath ${CMAKE_PREFIX_PATH}) -list(FILTER CMAKE_PREFIX_PATH INCLUDE REGEX "/debug") -find_library(zlib-ng_DEBUG_LIBRARIES - NAMES - zlibstatic - z-ng - zlib-ng - ) -set(CMAKE_PREFIX_PATH ${zlibngSavePrefixPath}) - -find_path(zlib-ng_INCLUDE_DIRS NAMES zlib-ng.h) - -include(FindPackageHandleStandardArgs) - -find_package_handle_standard_args(zlib-ng - FOUND_VAR - zlib-ng_FOUND - REQUIRED_VARS - zlib-ng_LIBRARIES - zlib-ng_INCLUDE_DIRS - ) - -mark_as_advanced(zlib-ng_LIBRARIES zlib-ng_INCLUDE_DIRS) - -if(zlib-ng_FOUND AND NOT TARGET zlib-ng::zlib-ng) - add_library(zlib-ng::zlib-ng UNKNOWN IMPORTED) - set_target_properties(zlib-ng::zlib-ng PROPERTIES - IMPORTED_LOCATION "${zlib-ng_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${zlib-ng_INCLUDE_DIRS}" - ) - if(zlib-ng_DEBUG_LIBRARIES) - set_target_properties(zlib-ng::zlib-ng PROPERTIES - IMPORTED_LOCATION_DEBUG "${zlib-ng_DEBUG_LIBRARIES}" - ) - endif() -endif()