Re: [CMake] bug or feature ? relative paths with INCLUDE_DIRECTORIES() in cmake 2.4.1

Alexander Neundorf a.neundorf-work at gmx.net
Fri May 12 03:09:30 EDT 2006


> --- Ursprüngliche Nachricht --- 
> Von: "Alexander Neundorf" <a.neundorf-work at gmx.net> 
> An: cmake at cmake.org 
> Betreff: [CMake] bug or feature ? relative paths with 
> INCLUDE_DIRECTORIES()	in cmake 2.4.1 
> Datum: Fri, 12 May 2006 01:26:20 +0200 (MEST) 
>  
> Hi,  
>   
> is it a bug or a feature ?  
>   
> The following CMakeLists.txt:  
>   
> include_directories( foo ${CMAKE_CURRENT_SOURCE_DIR}/bar)  
> add_executable(hello main.c)  
>   
> produces the flags:  
>   
> gcc ... -I/home/alex/src/test/bar -Ifoo  
>   
> I would have expected that foo is also interpreted as relative to  
> CMAKE_CURRENT_SOURCE_DIR, but apparently it isn't.  
> Bug or feature ?  
 
After some more thinking about it, I would consider it a bug. 
If I write 
add_executable( hello main.cpp) 
 
main.cpp is always interpreted as relative to CMAKE_CURRENT_SOURCE__DIR. 
So it should also work for directories given to INCLUDE_DIRECTORIES. 
So if a relative path is given to INCLUDE_DIRECTORIES() I think it should 
be interpreted as relative to CMAKE_CURRENT_SOURCE_DIR and converted to 
an absolute path. 
Maybe if the option CMAKE_ALWAYS_INCLUDE_CURRENT_DIR is enabled, it would 
also make sense to automatically add 
${CMAKE_CURRENT_BINARY_DIR}/<the_relative_path> to the include path. 
 
What do you think ? 
 
Bye 
Alex 
 

-- 
Analog-/ISDN-Nutzer sparen mit GMX SmartSurfer bis zu 70%!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer


More information about the CMake mailing list