[CMake] Fail target if buildtype is not RelWithDebInfo

Thomas Sondergaard ts at medical-insight.com
Wed Aug 27 08:45:45 EDT 2014


Thanks Petr,

It works. I ended up having to make it slightly more complicated to also 
work with the Ninja generator, but CMAKE_CFG_INTDIR was exactly what I 
was looking for.

Thanks,

Thomas

On 2014-08-27 13:48, Petr Kmoch wrote:
> Hi Thomas,
>
> you should be able to make this work using the variable CMAKE_CFG_INTDIR:
>
> if (WIN32)
>    add_custom_target(msi-installer
>      COMMAND IF NOT "${CMAKE_CFG_INTDIR}" == "RELWITHDEBINFO" (echo
> "msi-installer only works for build type RELWITHDEBINFO" && exit 1)
>      COMMAND ...)
> endif()
>
> Petr




More information about the CMake mailing list