For libraries that provide CMake targets when installed (eg. SDL2), vcpkg will only generate import files for Debug and Release (eg. SDL2Targets-debug.cmake and SDL2Targets-release.cmake). This leaves vcpkg/CMake to incorrectly default to Debug when using RelWithDebInfo and MinSizeRel, causing bugs like linking the wrong version or not copying the DLL (#2559 #3463).
One can workaround this at the project level, but this shouldn't be required:
set_target_properties(SDL2::SDL2 SDL2::SDL2main PROPERTIES
MAP_IMPORTED_CONFIG_MINSIZEREL Release
MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release
)
vcpkg should automatically support the RelWithDebInfo and MinSizeRel targets as Release, either by generating import files for all 3 or redirecting them like in the workaround above.
For libraries that provide CMake targets when installed (eg. SDL2), vcpkg will only generate import files for Debug and Release (eg. SDL2Targets-debug.cmake and SDL2Targets-release.cmake). This leaves vcpkg/CMake to incorrectly default to Debug when using RelWithDebInfo and MinSizeRel, causing bugs like linking the wrong version or not copying the DLL (#2559 #3463).
One can workaround this at the project level, but this shouldn't be required:
vcpkg should automatically support the RelWithDebInfo and MinSizeRel targets as Release, either by generating import files for all 3 or redirecting them like in the workaround above.