From f332f724ed80db389e9533ecfaf5e62122dc9666 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Thu, 10 Oct 2024 13:54:25 +0200 Subject: [PATCH] CMake Presets: The Prefix path is now appended, not overwritten --- CMakeLists.txt | 3 +++ builds/cmake/CMakePresets.json.template | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a7e4a24..f1bc4a4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,9 @@ option(LIBLCF_ENABLE_BENCHMARKS "Whether to build the benchmarks (default: OFF)" option(LIBLCF_ENABLE_INSTALL "Whether to add an install target (default: ON)" ${LIBLCF_MAIN_PROJECT}) set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Override CMAKE_DEBUG_POSTFIX.") +# Dependencies provided by CMake Presets +list(APPEND CMAKE_PREFIX_PATH "${LIBLCF_PREFIX_PATH_APPEND}") + # C++17 is required set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/builds/cmake/CMakePresets.json.template b/builds/cmake/CMakePresets.json.template index ad0098e0..38a3304f 100644 --- a/builds/cmake/CMakePresets.json.template +++ b/builds/cmake/CMakePresets.json.template @@ -18,7 +18,7 @@ "displayName": "Linux", "toolchainFile": "${sourceDir}/builds/cmake/LinuxToolchain.cmake", "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/linux-static" + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/linux-static" } }, { @@ -53,7 +53,7 @@ "name": "macos", "displayName": "macOS", "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/osx", + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/osx", "CMAKE_OSX_DEPLOYMENT_TARGET": "10.9" }, "condition": { @@ -68,7 +68,7 @@ "toolchainFile": "$env{EASYRPG_BUILDSCRIPTS}/emscripten/emsdk-portable/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake", "cacheVariables": { "LIBLCF_ENABLE_TOOLS": "OFF", - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/emscripten", + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/emscripten", "CMAKE_FIND_ROOT_PATH": "$env{EASYRPG_BUILDSCRIPTS}/emscripten" } }, @@ -77,7 +77,7 @@ "displayName": "Nintendo 3DS", "toolchainFile": "$env{DEVKITPRO}/cmake/3DS.cmake", "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/3ds" + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/3ds" }, "inherits": "dkp-user" }, @@ -86,7 +86,7 @@ "displayName": "Nintendo Switch", "toolchainFile": "$env{DEVKITPRO}/cmake/Switch.cmake", "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/switch" + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/switch" }, "inherits": "dkp-user" }, @@ -95,7 +95,7 @@ "displayName": "Nintendo Wii", "toolchainFile": "$env{DEVKITPRO}/cmake/Wii.cmake", "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{EASYRPG_BUILDSCRIPTS}/wii" + "LIBLCF_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/wii" }, "inherits": "dkp-user" },