[vcpkg.cmake][ports.cmake] Prefer STREQUAL over MATCHES (#23014)

Co-authored-by: Heiko Thiel <heiko.thiel@hpi.de>
This commit is contained in:
SunBlack 2022-05-24 21:11:39 +02:00 committed by GitHub
parent eddbb406cf
commit 6a66e95caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -245,21 +245,21 @@ elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$")
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$") elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$")
set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64) set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64)
else() else()
if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") if(CMAKE_GENERATOR STREQUAL "Visual Studio 14 2015 Win64")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 14 2015 ARM")
set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) set(Z_VCPKG_TARGET_TRIPLET_ARCH arm)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 14 2015")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) set(Z_VCPKG_TARGET_TRIPLET_ARCH x86)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 15 2017 Win64")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 15 2017 ARM")
set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) set(Z_VCPKG_TARGET_TRIPLET_ARCH arm)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 15 2017")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) set(Z_VCPKG_TARGET_TRIPLET_ARCH x86)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 16 2019$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 16 2019")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 17 2022$") elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 17 2022")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
else() else()
find_program(Z_VCPKG_CL cl) find_program(Z_VCPKG_CL cl)

View File

@ -95,7 +95,7 @@ if(PORT)
set(CURRENT_PACKAGES_DIR "${PACKAGES_DIR}/${PORT}_${TARGET_TRIPLET}") set(CURRENT_PACKAGES_DIR "${PACKAGES_DIR}/${PORT}_${TARGET_TRIPLET}")
endif() endif()
if(CMD MATCHES "^BUILD$") if(CMD STREQUAL "BUILD")
set(CMAKE_TRIPLET_FILE "${TARGET_TRIPLET_FILE}") set(CMAKE_TRIPLET_FILE "${TARGET_TRIPLET_FILE}")
if(NOT EXISTS "${CMAKE_TRIPLET_FILE}") if(NOT EXISTS "${CMAKE_TRIPLET_FILE}")
message(FATAL_ERROR "Unsupported target triplet. Triplet file does not exist: ${CMAKE_TRIPLET_FILE}") message(FATAL_ERROR "Unsupported target triplet. Triplet file does not exist: ${CMAKE_TRIPLET_FILE}")
@ -147,7 +147,7 @@ if(CMD MATCHES "^BUILD$")
if(DEFINED PORT) if(DEFINED PORT)
include("${SCRIPTS}/build_info.cmake") include("${SCRIPTS}/build_info.cmake")
endif() endif()
elseif(CMD MATCHES "^CREATE$") elseif(CMD STREQUAL "CREATE")
file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}" NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}" NATIVE_VCPKG_ROOT_DIR)
file(TO_NATIVE_PATH "${DOWNLOADS}" NATIVE_DOWNLOADS) file(TO_NATIVE_PATH "${DOWNLOADS}" NATIVE_DOWNLOADS)
if(NOT DEFINED PORT_PATH) if(NOT DEFINED PORT_PATH)