Skip to content

Commit

Permalink
fix: load detected triplet (#23)
Browse files Browse the repository at this point in the history
Signed-off-by: l.feng <[email protected]>
  • Loading branch information
msclock authored Dec 25, 2024
1 parent 806f38c commit 7952e46
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions template/cmake/vcpkg/bootstrap/vcpkg_load_triplet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,22 @@ macro(_vcpkg_load_triplet)
set(_community_triplet "triplets/community/${VCPKG_TARGET_TRIPLET}.cmake")

if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_triplet}")
include("${CMAKE_CURRENT_LIST_DIR}/${_triplet}")
set(_load_triplet "${CMAKE_CURRENT_LIST_DIR}/${_triplet}")
elseif(EXISTS "${_VCPKG_ROOT}/${_triplet}")
include("${_VCPKG_ROOT}/${_triplet}")
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_community_triplet}")
include("${CMAKE_CURRENT_LIST_DIR}/${_community_triplet}")
set(_load_triplet "${_VCPKG_ROOT}/${_triplet}")
elseif(EXISTS "${_VCPKG_ROOT}/${_community_triplet}")
include("${_VCPKG_ROOT}/${_community_triplet}")
set(_load_triplet "${_VCPKG_ROOT}/${_community_triplet}")
else()
message(
FATAL_ERROR
"Triplet ${VCPKG_TARGET_TRIPLET} not found at ${CMAKE_CURRENT_LIST_DIR}/${_triplet} or ${_VCPKG_ROOT}/${_triplet}"
)
endif()

message(STATUS "Loading triplet: ${_load_triplet}")
include(${_load_triplet})

unset(_triplet)
unset(_community_triplet)
unset(_load_triplet)
endmacro(_vcpkg_load_triplet)

0 comments on commit 7952e46

Please sign in to comment.