[CMake] CMake ignores CPLUS_INCLUDE_PATH?

Eric Noulard eric.noulard at gmail.com
Mon Oct 19 16:37:05 EDT 2009


2009/10/19 Eric Noulard <eric.noulard at gmail.com>:
> 2009/10/19 David Doria <daviddoria at gmail.com>:
>>> You can use $ENV{CPLUS_INCLUDE_PATH} to get the contents of the path.
>>>
>>
>> I tried to do this:
>> INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} $ENV{CPLUS_INCLUDE_PATH})
>
> I think the appropriate syntax should be:
>
> INCLUDE_DIRECTORIES($ENV{CPLUS_INCLUDE_PATH}))
>
> even if I don't know if comma separated value is supported because

to be more specific, your entries are separated by ":" thus you
may have to split the entries using some CMake scripting
(look at the string command) before giving the separate entries into
INCLUDE_DIRECTORIES.

However from the value you showed us:
:/home/doriad/src/glui-2.36/src/include/GL:/home/doriad/src/CGAL-3.5/include:/usr/lib/qt-3.3/include/

May be you can do it in a more "CMake-ish" way using

for OpenGL that would be:

FIND_PACKAGE(OpenGL)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})

etc...

if the FindOpenGL.cmake script given with CMake does not suits your needs
then you may craft your own.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list