In my CMake script I'm adding a custom configuration type like suggested in the CMake FAQ:
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release MyRelease)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Reset the configurations to what we need" FORCE)
endif()
I would like to have a MyRelease configuration in my generated Visual Studio 2015 project that behaves like Release but with an additional post-build step. The problem is, that it appears to use the Debug configuration as the basis by default. This, in turn, becomes a problem when using imported targets that don't explicitly specify the library location for my own configuration type. For example, when using the imported target opencv_core
it will try to link against the opencv_core2413d.lib which is defined specifically for Debug configuration.
Is there a way to let custom configuration types inherit from the Release configuration type?
Note: I'm using CMake version 3.12.