[CMake] Cmake gui and cli

Eric Noulard eric.noulard at gmail.com
Thu Jul 16 15:21:02 EDT 2009


2009/7/16 Bill Hoffman <bill.hoffman at kitware.com>:
> Alin M Elena wrote:
>>>
>>> I think the previous posts are missing the question....   I think what
>>> is wanted is a way to run cmake-gui pick some options, and then generate
>>> a -D command line equivalent to the options that were picked in
>>> cmake-gui.  This is not possible, and would be difficult to implement.
>>
>> Thanks Bill, exactly what I wanted to know.  Why is that difficult?
>>
>
> All options in the cache are stored together, some are set from the
> cmakelists.txt files and some are set by users.  I suppose camke-gui could
> try and track all changes made by the user and collect them up. I am not
> sure that the set of options would be portable to a different machine.

I may add some other similar possible issues.

Sometimes as Bill said some options do appear on a specific machine basis
like in
IF (WIN32)
     OPTION(WHATEVER "You know"  FALSE)
ENDIF(WIN32)

of

FIND_PACKAGE(Doxygen)
IF (DOXYGEN_FOUND)
     OPTION(BUILD_DOC "Build documentation using Doxygen" OFF)
ENDIF(DOXYGEN_FOUND)

or even more, one option may trigger another one

OPTION(LEVEL1 "level1" OFF)
IF (LEVEL1)
    OPTION(LEVEL2 "level2" OFF)
ENDIF(LEVEL1)

in this second case the GUI will show you the LEVEL2 option
only if you set LEVEL1 to ON and hit configure.

The CMake gui (QT or curse) have an iterative usage pattern

1) configure
2) select change
3) eventually go to 1
4) generate

The pure command line is usually "one-shot" trying to get the
"preferred" configuration.

Like Bill said a possible way to do it would be to track user-modified values
vs programmatically chosen ones. But you'll have to deal with
user-modified values depending on programmatically chosen path,
not that easy to do.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list