This is what I do:<br><br># Add configuration for ReleaseNoOutfiles builds based on the release configuration<br># =================================================================================<br>set(CMAKE_C_FLAGS_RELEASENOOUTFILES ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "Flags used by the compiler during ReleaseNoOutfiles builds")<br>
set(CMAKE_CXX_FLAGS_RELEASENOOUTFILES ${CMAKE_CXX_FLAGS_RELEASE} CACHE STRING "Flags used by the compiler during ReleaseNoOutfiles builds")<br>set(CMAKE_EXE_LINKER_FLAGS_RELEASENOOUTFILES ${CMAKE_EXE_LINKER_FLAGS_RELEASE} CACHE STRING "Flags used by the linker for executables during ReleaseNoOutfiles builds")<br>
set(CMAKE_SHARED_LINKER_FLAGS_RELEASENOOUTFILES ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} CACHE STRING "Flags used by the linker for shared libraries during ReleaseNoOutfiles builds")<br>set(CMAKE_MODULE_LINKER_FLAGS_RELEASENOOUTFILES ${CMAKE_MODULE_LINKER_FLAGS_RELEASE} CACHE STRING "Flags used by the linker for loadable modules during ReleaseNoOutfiles builds")<br>
<br>mark_as_advanced(<br> CMAKE_C_FLAGS_RELEASENOOUTFILES<br> CMAKE_CXX_FLAGS_RELEASENOOUTFILES<br> CMAKE_EXE_LINKER_FLAGS_RELEASENOOUTFILES<br> CMAKE_SHARED_LINKER_FLAGS_RELEASENOOUTFILES <br> CMAKE_MODULE_LINKER_FLAGS_RELEASENOOUTFILES<br>
)<br><br># This variable is only set for multi-config IDE generators like MSVC<br>if(CMAKE_CONFIGURATION_TYPES)<br> list(APPEND CMAKE_CONFIGURATION_TYPES ReleaseNoOutfiles)<br> list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)<br>
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}"<br> CACHE STRING "Semicolon separated list of supported configuration types [Debug|Release|MinSizeRel|RelWithDebInfo|ReleaseNoOutfiles]"<br>
FORCE)<br>endif()<br><br>I don't know if I have set *all* the relevant variables but it seems to work for me so far. It would definitely be nicer if cmake had a built-in command to create new build configurations based upon an existing one. Something like:<br>
<br> create_build_config(ReleaseNoOutfiles Release)<br><br>--<br>Glenn<br><br><div class="gmail_quote">On 6 June 2011 04:50, Ivan Neeson <span dir="ltr"><<a href="mailto:zzymyn@gmail.com">zzymyn@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Is it possible to easily add a new build configuration that is identical to an existing configuration (for example "MinSizeRel2" which has exactly the same settings as "MinSizeRel")?<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>