[CMake] Adding a buildstep to all targets

Hendrik Sattler post at hendrik-sattler.de
Fri Oct 9 05:57:23 EDT 2009


Zitat von jens persson <jens at persson.cx>:
> I'm trying to convert an old home grown buildsystem based on make to
> cmake and one of the requisites[1] is that I need to build each
> executable in two versions, one with debug symbols and one without. I
> have solved it now with a add_custom_command call for every target
> like this
[...]
> Is there a way to do this that I haven't found yet?

Use the RelWithDebInfo build type and install once using the install  
target and once using the install/strip target. No need to do anything  
in your CMakeLists.txt, then. Maybe the CMAKE_INSTALL_PREFIX (or some  
custom own variable) should differ between both install calls.

HS




More information about the CMake mailing list