[CMake] CHECK_C_SOURCE_COMPILES and include_directories

Rolf Eike Beer eike at sf-mail.de
Sun May 10 07:54:18 EDT 2015


Florian Weimer wrote:
> * Rolf Eike Beer:
> > Florian Weimer wrote:
> >> Is there a way to make CHECK_C_SOURCE_COMPILES honor the discovered
> >> include directories?
> >> 
> >  cmake --help-module CheckCSourceCompiles
> > 
> > The following variables may be set before calling this macro to modify
> > the way the check is run:
> > […]
> > 
> >  CMAKE_REQUIRED_INCLUDES = list of include directories
> 
> I saw that, but I thought this happens behind the scenes.  Do I have
> to set this variable in addition to the include_directories directive?

Yes, include_directories() only affects target, i.e. add_executable and 
friends, but not macros like CHECK_C_SOURCE_COMPILES. Those will explicitely 
look at those variables.

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150510/348c6f56/attachment.sig>


More information about the CMake mailing list