[CMake] CPack: Packaging debug and release configurations in a single zip

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Feb 7 13:41:12 EST 2013


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.levinsen at gmail.com <mailto:yngve.levinsen at 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.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130207/5184188f/attachment.htm>


More information about the CMake mailing list