[CMake] Fwd: Debug and Release build from a make option

Mauro Ziliani faresoftware.it at gmail.com
Thu Aug 21 10:16:54 EDT 2014


---------- Forwarded message ----------
From: Mauro Ziliani <faresoftware.it at gmail.com>
Date: 2014-08-21 16:16 GMT+02:00
Subject: Re: [CMake] Debug and Release build from a make option
To: Nils Gladitz <nilsgladitz at gmail.com>


So the best choice for Makefile compilation environment is use two
different folder out-of-the-source: one for debug build and another for
release?


2014-08-21 13:39 GMT+02:00 Nils Gladitz <nilsgladitz at gmail.com>:

On 21.08.2014 13:27, Mauro Ziliani wrote:
>
>> Hi all.
>> I came from bakefile 0.2.9 generator.
>> In my projects I defined the default build type as debug.
>>
>> So when I run
>>
>> make
>>
>> my project will build in debug mode.
>>
>> When I need to produce the final executable i have to run
>>
>> make BUILD=release
>>
>> and I'll get the final release executable.
>>
>> How can I achieve the same behavious in CMake (3.0)?
>>
>
> CMake has multi- (e.g. Visual Studio, XCode) and single-configuration
> (e.g. Makefile, Ninja) generators.
>
> With multi-configuration generators you pick the build type at build time
> (build tool invocation).
> With single-configuration generators you pick the build type at
> configuration time (cmake invocation).
>
> Assuming one of the single-configuration Makefile generators you tell
> cmake about the build type with e.g.
> -DCMAKE_BUILD_TYPE=Debug or -DCMAKE_BUILD_TYPE=Release.
>
> I would maintain one out of source tree build directory per configuration
> of interest.
>
> Nils
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140821/abcbcbc3/attachment.html>


More information about the CMake mailing list