[CMake] configuration based add_custom_command

Robert Bielik robert.bielik at xponaut.se
Wed Aug 24 07:43:32 EDT 2011


Michael Hertling skrev 2011-08-24 13:13:
> Suppose
>
> ADD_CUSTOM_COMMAND(OUTPUT source.c CONFIGURATION Release COMMAND ...)
> ADD_EXECUTABLE(main ... source.c)
>
> and then:
>
> cmake -DCMAKE_BUILD_TYPE=Debug<path/to/source>
>
> How would you like this case to be handled by CMake? Note that with
> multi-config generators, the build type aka configuration is chosen
> at build time, and the user is free to define custom build types.

I'd expect the obvious, i.e. the ADD_CUSTOM_COMMAND shall not be included in the build if CMAKE_BUILD_TYPE==Debug. I see no conflict with
multi-config generators either.

Regards,
/Rob


More information about the CMake mailing list