[CMake] INCLUDE_DIRECTORIES and relative path

jago jagoc jagovic at gmail.com
Tue Nov 3 09:44:25 EST 2009


Hi Bill,
Sorry if i reply the issues but it's strange that the
INCLUDE_DIRECTORIES add the project dir to all its parameter.
Is there a way to include some dir with  INCLUDE_DIRECTORIES macro
without the project directory before?
I would like to add only a relative path ..\..\include to my  Visual
studio solution c++ properties( by cmakelist.txt) i don't want the
absolute path c:\myprojectdir\include. Is it possible?

Any suggestion?

Thank you,
Jagovic


2009/11/2 Bill Hoffman <bill.hoffman at kitware.com>:
> jago jagoc wrote:
>>>>
>>>> jago jagoc wrote:
>>>> Hi,
>>>> I am some problem using INCLUDE_DIRECTORIES macro, i am using Cmake
>>>> 2.6 - path 0 and Visual studio 2005.
>>>> In my Cmakelist.txt
>>>>
>>>> ...
>>>> SET(MYINCLUDE_DIR "../3rdParty/include" CACHE STRING "My include dir
>>>> You may add additional search paths here. Use ; to separate multiple
>>>> paths.")
>>>>
>>>>
>>>> INCLUDE_DIRECTORIES( ${MYINCLUDE_DIR } )
>>>> ...
>>
>>> You need to remove the extra space...
>>
>>> INCLUDE_DIRECTORIES( ${MYINCLUDE_DIR} )
>>
>>> -Bill
>>
>> Hi Bill,
>> thank you for your answer, i tried without the space but the result is
>> the same, e.x.
>> if i write in cmakelists.txt
>> ...
>>
>> INCLUDE_DIRECTORIES( "../../include" )
>> or
>> SET(MYINCLUDE_DIR "../3rdParty/include" CACHE STRING "My include dir
>> You may add additional search paths here. Use ; to separate multiple
>>  paths.")
>>
>> INCLUDE_DIRECTORIES( ${MYINCLUDE_DIR} )
>> ...
>> in the solution i find( c++ propierties):
>>
>>
>> F:/Develop/nameofproject/../3rdParty/include;F:/Develop/nameofproject/../../include;
>>
>
> Use this:
>
>${CMAKE_CURRENT_SOURCE_DIR}/../../include
> -Bill
>


More information about the CMake mailing list