[CMake] Can CMake intelligently support GCC "-include" directive

Richard Lang r_e_lang at hotmail.com
Thu Dec 17 19:05:33 EST 2015


Posted same question on stack overflow
(http://stackoverflow.com/questions/34296887/can-cmake-intelligently-support-gcc-include-directive?noredirect=1#comment56386884_34296887)
and got the suggestion that I use add_definitions() to pass the
preprocessor defines from the preinclude file to cmake.

I used target_compile_definitions() (rather than add_definitions(), as
my CMakeList.txt is not in the workspace root) and while the defines
in question are correctly included in the "C" build, there is no sign
of them in the Eclipse .project/.cproject files and I am no closer to
an Eclipse CDT Indexer configured ready-to-go from the CMake project
generation.

Is this a CMake bug/omission?


More information about the CMake mailing list