Map configuration also for single configuration generators (#10397)

This commit is contained in:
Alexander Neumann 2020-03-25 21:47:07 +01:00 committed by GitHub
parent da0a154852
commit 52273558f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,10 +26,9 @@ if(VCPKG_TOOLCHAIN)
return()
endif()
if(DEFINED CMAKE_CONFIGURATION_TYPES) #Generating with a multi config generator
#If CMake does not have a mapping for MinSizeRel and RelWithDebInfo in imported targets
#it will map those configuration to the first valid configuration in CMAKE_CONFIGURATION_TYPES.
#By default this is the debug configuration which is wrong.
#it will map those configuration to the first valid configuration in CMAKE_CONFIGURATION_TYPES or the targets IMPORTED_CONFIGURATIONS.
#In most cases this is the debug configuration which is wrong.
if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL)
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release;")
if(VCPKG_VERBOSE)
@ -42,7 +41,6 @@ if(DEFINED CMAKE_CONFIGURATION_TYPES) #Generating with a multi config generator
message(STATUS "VCPKG-Info: CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO set to RelWithDebInfo;Release;")
endif()
endif()
endif()
if(VCPKG_TARGET_TRIPLET)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")