[CMake] why no cumulative variable operations via the commandline?

René J. V. Bertin rjvbertin at gmail.com
Sat Mar 19 05:52:57 EDT 2016


Hi,

I've been wondering about something that is a real stumbling block in a 
build/distribution system like MacPorts where settings can be modified in any 
number of consecutive steps. For instance, depending on what dependencies a 
package ("port") requires and how those dependencies are installed, elements may 
be added to the module search path repeatedly.

In cmake language one does cumulative operations like that explicitly, but I'm 
not aware of any way to do that on the command line.

Is there a reason why one cannot do something like 

cmake -DCMAKE_FOO+=bar

or

CMAKE -ACMAKE_FOO=bar (-A for add instead of define)

(or -DCMAKE_FOO-=bar, for that matter...) ?

Thanks,
René



More information about the CMake mailing list