[CMake] System Include Directories

Brad King brad.king at kitware.com
Thu Aug 31 10:11:03 EDT 2006


Yannick Koehler wrote:
> Is there a command such as
> 
> INCLUDE_SYSTEM_DIRECTORIES that exists?
> 
> Which would add the directories in CFLAGS such as -isystem DIR for
> both C and C++?

No.  Does such a flag exist on any compilers other than GCC?  I think
that for GCC if a directory is given with both -I and -isystem then the
-isystem overrides and pretends the -I version is not there.  Therefore
you can still use INCLUDE_DIRECTORIES to get the directory into the
build system on all platforms and then add the flags for GCC to the
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS variables when CMAKE_COMPILER_IS_GNUCC
and/or CMAKE_COMPILER_IS_GNUCXX is true.

-Brad


More information about the CMake mailing list