[CMake] CMake ignores CPLUS_INCLUDE_PATH?

Eric Noulard eric.noulard at gmail.com
Mon Oct 19 16:42:25 EDT 2009


2009/10/19 David Doria <daviddoria at gmail.com>:
> On Mon, Oct 19, 2009 at 4:31 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
>> 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
>> the doc says:
>
> My understanding was that:
> INCLUDE_DIRECTORIES(a)
> sets INCLUDE_DIRECTORIES to a
>
> where
> INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} a)
> sets INCLUDE_DIRECTORIES to what it was PLUS a
>
> Is this correct?

Nope.
You should really RTFM   :-)

"**Add** the given directories to those searched by the compiler for
include files."

> Also, these are colon separated values in the .bashrc file - so is the
> answer that cmake cannot do this?

It was not meant for, because there is better way to it :-)

> If so, does it seem like a reasonable feature request?

I don't think it's a desirable mainline feature (but that's my
personnal point of view)
because discovering include path should be done with FIND_PACKAGE.

However if you want this feature I think you can perfectly implement it with
some CMake scripting, and contribute the script here on the list in order
to make other CMake react about it.


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


More information about the CMake mailing list