[CMake] Add include files

Alexander Neundorf a.neundorf-work at gmx.net
Mon Nov 12 12:44:28 EST 2007


On Sunday 11 November 2007, Yinon Ehrlich wrote:
> Hi,
>
> * I'm new to CMake, trying to convert our existing GNU Makefiles to CMake.
> * I have a GCC compilation line that uses GCC's "-include" direction

The argument to -include is a file which will be included, right ?

> (Instead of having multiple identical "#include" lines within the source
> code.)
>
>   ==> Does anyone has an idea how can I implement this feature with CMake ?

You could do it using ADD_DEFINITIONS(-include ...)
but I would suggest you actually include that file everywhere (using -include 
*might* make the cmake dependency scanning miss some dependencies)

Alex


More information about the CMake mailing list