Hi, I think you are fighting the tool in any case, because you are asking to build multiple configurations in one build folder (?). Normally you would create one build folder per configuration.. Which I guess is what you are doing today.
Instead of specifying the compile flags manually you can instead use the variables ${CMAKE_C_FLAGS_RELEASE} and ${CMAKE_C_FLAGS_DEBUG}, and you could set it so it only builds the second target based on an option: option(BUILD_BOTH_LIBVERSIONS "Build both debug and optimized library" OFF) if(BUILD_BOTH_LIBVERSIONS) add_library(...) set_target_properties(...) set_target_properties(...) install(...) endif() Cheers, Yngve On 02/07/2013 07:26 PM, Patrick Johnmeyer wrote: > On Thu, Feb 7, 2013 at 3:12 AM, Yngve Inntjore Levinsen > <yngve.levin...@gmail.com <mailto:yngve.levin...@gmail.com>> wrote: > > Did you try to create two targets and add per-target compile flags? > > > What you suggest is replacing configurations with targets. That may be > possible, but runs counter to how CMake natively works. I feel like I > would be fighting the tool to do it this way. >
-- 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