On Friday 09 October 2009, Hendrik Sattler wrote:
> Zitat von jens persson <[email protected]>:
> > 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.

Yes.
Another solution would be that you write your own custom foo_add_executable() 
macro, which you then always use instead of the plain add_executable():

macro(FOO_ADD_EXECUTABLE _target ...args)
   add_executable(${_target} ...)
   add_custom_command(TARGET ${_targets} ... }
endmacro(FOO_ADD_EXECUTABLE ...args)

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to