CMake: Use cmake_path to check if vcpkg triplets are ours

This makes the check work with possibly-normalized windows paths
This commit is contained in:
Andrew Kaster 2025-06-22 12:51:45 -06:00 committed by Andrew Kaster
commit ffd946d47d
Notes: github-actions[bot] 2025-06-22 19:34:41 +00:00

View file

@ -33,8 +33,8 @@ if (NOT DEFINED CACHE{VCPKG_TARGET_TRIPLET} AND NOT DEFINED CACHE{VCPKG_HOST_TRI
endif()
# And then, only tweak settings if the triplets are ours
string(FIND "${VCPKG_OVERLAY_TRIPLETS}" "${CMAKE_CURRENT_SOURCE_DIR}" VCPKG_OVERLAY_TRIPLETS_MATCH)
if (VCPKG_OVERLAY_TRIPLETS_MATCH EQUAL -1)
cmake_path(IS_PREFIX CMAKE_CURRENT_SOURCE_DIR "${VCPKG_OVERLAY_TRIPLETS}" NORMALIZE TRIPLET_IS_OURS)
if (NOT TRIPLET_IS_OURS)
return()
endif()