[CMake] get things back: add_definitions

Dave Milter davemilter at gmail.com
Wed Jun 11 17:01:31 EDT 2008


Hello.

I try to turn on usage of precompiled headers in my project on linux,
I grab PCHSupport_26.cmake from
http://public.kitware.com/Bug/view.php?id=1260 here,
and take precompile example from qt: examples/qmake/precompile.

I create CMakeLists.txt like this:
ADD_EXECUTABLE(precompile
...
stable.h
...
)
ADD_PRECOMPILED_HEADER(precompile ${CMAKE_CURRENT_SOURCE_DIR}/stable.h)

so far, so good,

but when I try compile it, I get:
precompile_Debug.h++: not used because `QT_DEBUG' is defined.

Looks like ADD_PRECOMPILED_HEADER macros from PCHSupport_26.cmake, can
not get definitions in right way,
I look at code, and it call:
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)

to get things like -DQT_DEBUG, but this call return empy result,
what is this, bug in cvs version of cmake, or it should be so,
and this is bug in macros, but then what right way to get things which added by
ADD_DEFINITIONS ?


More information about the CMake mailing list