From 93019b5d8336bd3190380bf07b13452aabd68aec Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 25 Oct 2024 18:10:11 +0200 Subject: [PATCH 1/2] Find sip-build with vcpkg --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 118d611bd20e..ab0d71d0312e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ set(SDK_PATH "" CACHE STRING "Build with VCPKG SDK") if(NOT SDK_PATH STREQUAL "") message(STATUS "Building with SDK -- ${SDK_PATH}") set(CMAKE_TOOLCHAIN_FILE "${SDK_PATH}/scripts/buildsystems/vcpkg.cmake") + set(VCPKG_INSTALL_PREFIX "${SDK_PATH}/installed") if(APPLE AND NOT VCPKG_TARGET_TRIPLET) set(VCPKG_TARGET_TRIPLET "x64-osx-dynamic") endif() @@ -43,7 +44,7 @@ else() endif() if(WITH_VCPKG) - list(APPEND CMAKE_PROGRAM_PATH "${VCPKG_INSTALL_PREFIX}/${VCPKG_TARGET_TRIPLET}/") + list(APPEND CMAKE_PROGRAM_PATH "${VCPKG_INSTALL_PREFIX}/${VCPKG_TARGET_TRIPLET}/tools/python3/Scripts/") set(PREFER_INTERNAL_LIBS FALSE) else() set(PREFER_INTERNAL_LIBS TRUE) From 20da4d86a763bf07519c79babef57fcd0f48f59f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 25 Oct 2024 18:23:20 +0200 Subject: [PATCH 2/2] Fix PREFER_INTERNAL_LIBS --- CMakeLists.txt | 6 +++--- src/core/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab0d71d0312e..ed4a9fb9311b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,8 +275,8 @@ if(WITH_CORE) endif() # try to configure and build POLY2TRI support - set (WITH_INTERNAL_POLY2TRI PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether POLY2TRI should be built from internal copy") - set (WITH_INTERNAL_MESHOPTIMIZER PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy") + set (WITH_INTERNAL_POLY2TRI ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether POLY2TRI should be built from internal copy") + set (WITH_INTERNAL_MESHOPTIMIZER ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy") # try to configure and build POSTGRESQL support set (WITH_POSTGRESQL TRUE CACHE BOOL "Determines whether POSTGRESQL support should be built") @@ -389,7 +389,7 @@ if(WITH_CORE) find_package(EXPAT REQUIRED) find_package(Spatialindex REQUIRED) find_package(LibZip REQUIRED) - set (WITH_INTERNAL_NLOHMANN_JSON PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used") + set (WITH_INTERNAL_NLOHMANN_JSON ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used") find_package(nlohmann_json REQUIRED) # The following bypasses the FindSQLite3 module introduced in CMake 3.14 diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index d333c406f85f..b877c552054a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2348,7 +2348,7 @@ if(WITH_INTERNAL_MESHOPTIMIZER) ) else() find_package(meshoptimizer CONFIG REQUIRED) - target_link_libraries(qgis_core PRIVATE meshoptimizer::meshoptimizer) + target_link_libraries(qgis_core meshoptimizer::meshoptimizer) endif() # require c++17