Nicholas Braden wrote:

> sense. Could you give an example of when you would find them useful? I
> think maybe I am not understanding what you want.

Yeah, I realise my explanation may not have been very clear.

> If you just want to pass a list of values to a variable on the command
> line, separate the values with semicolons:
> cmake "-DMY_LIST=example value 1;example value 2"


Now take an example where you are in fact assembling the commandline in 
subsequent steps. A good example would be a build system like MacPorts that 
uses 
a kind of header files (so-called PortGroups) that can be included by the build 
scripts for packages of dependent software (say, the Kate5 editor). There's a 
PortGroup for cmake itself, and there's a PortGroup for Qt5 and one for the KF5 
frameworks. Each of those PortGroups can provide an element for MY_LIST (think 
of the module path, or preprocessor tokens), but evidently they cannot make 
assumptions about the contents of the variable.

In other words, it would make sense for certain types of programmatically 
generated commandlines to do things like

cmake -DMY_LIST+=val1 -DMY_LIST+=val3 -DMY_LIST+=val2 

At the moment we can do this reliably by using our own registers, one for each 
CMake variable that might be used this way, splicing them into the commandline 
just before invoking cmake. Not impossible, but somewhat of a hassle and a pity 
for a feature that seems useful and probablye rather trivial to implement.

CMake commandline can get quite long, so this might even make sense as a 
convenience for composing one manually.

Of course it would be convenient to have a concatenation operator in the cmake 
language too ;)

R


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to