[CMake] Automatic out of source build's possible?

Martin O'Brien martin.matthew.obrien at gmail.com
Tue Feb 8 03:39:38 EST 2011


Indeed.  There's also just typing -DENABLE-<something> instead of
-DENABLE-<something>=ON due to being used to --enable-<something>.  I find
myself committing unintentionally all the time, and I've used CMake for a
fairly long time.  CMake of course flags it, but it's discouraging (IMO) to
new users.


mm





-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of
Michael Wild
Sent: Tuesday, February 08, 2011 3:32 AM
To: cmake at cmake.org
Subject: Re: [CMake] Automatic out of source build's possible?

And there's the hidden trap that the -D options must be *before* the -P
option. Very nasty, especially for people who never used CMake before.

Michael

On 02/08/2011 09:27 AM, Martin O'Brien wrote:
> Absolutely, and that is what I do in some cases, but in the particular
case
> that I described - which is what I had in mind; I should have been clearer
-
> it doesn't help, as it's still -D... syntax.
> 
> 
> mm
> 
> -----Original Message-----
> From: Eric Noulard [mailto:eric.noulard at gmail.com] 
> Sent: Tuesday, February 08, 2011 3:26 AM
> To: Martin O'Brien
> Cc: cmake at cmake.org
> Subject: Re: [CMake] Automatic out of source build's possible?
> 
> 2011/2/8 Martin O'Brien <martin.matthew.obrien at gmail.com>:
>> While I too find myself sometimes wanting convenience scripts - some 
>> people find the use of '-DENABLE_<whatever>=ON' instead of
> --enable-<whatever>'
>> foreign, for example - the problem with them, IMO, is that they're 
>> impossible to make crossplatform without requiring the presence of 
>> some tool
>> - perl, python, bash, whatever - on each system in a location that can 
>> be located pre-configure, which is exactly what using cmake gets you out
> of.
> 
> You can use CMake instead of perl, python etc...
> you write your CMake script  and then propose to the user to run,
something
> like:
> 
> cmake -P easyBuild.cmake
> 
> Many [portable] CMake commands are usable for that, mainly file( ...),
> execute_process, string, message.
> 
> As an example I did propose in the past a CMake script which can be used
to
> build a new CMake version (provided you already have one installed) with
the
> following single line:
> 
> cmake -P CMake-autobuild.cmake
> 
> You can write a similar cross-platform script(s) for your users.
> It doesn't give you the possibility to use --enable but it's easy to use
for
> your user and is definitely cross-platform.
> 
> If some options have to be chosen by the users they can either edit the
> script or you may launch cmake-gui / ccmake at the end of the script in
> order to give a chance to the user to select  the choices.
> 
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org


_______________________________________________
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



More information about the CMake mailing list