[CMake] COMPILE_FLAGS suggestion

Brandon J. Van Every bvanevery at gmail.com
Wed Feb 15 04:49:50 EST 2006


SET_TARGET_PROPERTIES(file PROPERTIES COMPILE_FLAGS
  "-DBLAH -DBLLAH -DBLLAAHH")

is a very common form that will be used heavily by people in CMake 2.3 
onwards.  Anybody who has to do lotsa trivial combos of libraries will 
be doing it; for instance, shared vs. static libraries, and debug vs. 
release libraries.  The quotes around the flags are necessary because 
items in a PROPERTIES list have to come in pairs.  I humbly submit that 
the following syntax would be of great use to people:

SET_COMPILE_FLAGS(file -DBLAH -DBLLAH -DBLLAAHH)

so that they don't have to be "quote paranoid" about everything, and 
also have less to type.  I would have created a macro for this, but my 5 
minute perusal of the docs did not yield a painless way to manipulate 
ARGV.  On the positive side, at least I finally understood at an 
intuitive level what Scheme's CAR and CDR are for.  (It's so you can 
knock the front off the arguments.)


Cheers,
Brandon Van Every



More information about the CMake mailing list