[CMake] COMPILE_DEFINITIONS vs. ADD_DEFINITIONS

Gregory Sharp gregsharp.geo at yahoo.com
Sat May 30 01:29:19 EDT 2009


Hi, 

After some struggle, I learned that ADD_DEFINITIONS and
COMPILE_DEFINITIONS are different.  The ADD_DEFINITIONS allows 
for -D, but COMPILE_DEFINITIONS does not.

For example, this works:

ADD_DEFINITIONS(${wxWidgets_DEFINITIONS})

but not this:

SET_SOURCE_FILES_PROPERTIES(mondoshot_main.cpp
  PROPERTIES COMPILE_DEFINITIONS
  ${wxWidgets_DEFINITIONS}
  )

Is this a bug or a feature?  

Any clean way to convert to COMPILE_DEFINITIONS format?

Greg Sharp
gregsharp at geocities.com



      


More information about the CMake mailing list