What I need to do is to setup my excecutable name to be
program-debug for debug builds and
program-release(or whatever) for other builds
I want to do it in a true cross-platform way and what is also very important - I want to target XCode and VS2008 - so when I change configuration in a kind of drop-down list, it must also have correct names for output! I do no want to regenerate .vcproj or .xcodeproj with other -D option (but I will have to if will not found a solution)
AFAIK cmake variable CMAKE_BUILD_TYPE should work for make-based generators - in is evaluated at make time (Correct me if I am wrong)
Basically it is how to setup target options (not nessesary name) depending on configuration in some IDEs/build system. It can be too specific for overall cmake goals, but maybe you can help.
Thanks a lot!
Take a look at the list of target properties: One of those is the OUTPUT_NAME and OUTPUT_NAME_<CONFIG>. The last one can be set for each config-type (Debug, Release, MinSizeRel, etc.) You can set them on your program with set_target_properties, e.g.:
project( YourProject )
add_executable( myprogram ${YourSources} )
set_target_properties( myprogram PROPERTIES OUTPUT_NAME_DEBUG program-debug )
set_target_properties( myprogram PROPERTIES OUTPUT_NAME_RELEASE program-release )
Take care that you need to set RUNTIME_OUTPUT_NAME_<CONFIG> and/or LIBRARY_OUTPUT_NAME_<CONFIG> as well in some cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With