[CMake] Relative (source files) vs Absolute (include files) path

David Cole david.cole at kitware.com
Tue Feb 2 22:19:50 EST 2010


On Tue, Feb 2, 2010 at 6:23 PM, Brian Davis <bitminer at gmail.com> wrote:

>
> I noticed that if I have a buried CMakeLists.txt file which contains the
> following
>
> file(GLOB_RECURSE DICOM_TEST_SERVER_SRC src *.cpp )
>
> and
>
> INCLUDE_DIRECTORIES(
>     include
> )
>
> Where src contains cpp files and include contains include files CMake uses
> absolute paths for include path, but relative directories for the source.
>
> examples produced by cmake:
>
> src:
>
> Creating temporary file
> "c:\projects\NIH2009\source\branches\trunk\build\dvip4-Win64\cpp_source\app\dicomserver\dvipdicomsvr.dir\Debug\RSP00006D57442788.rsp"
> with contents [ /Od /I
> "C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\NVIDIA_GPU_Computing_SDK_2.2\common\inc"
> /I
> "C:\projects\NIH2009\source\branches\trunk\build\Windows-6.1\install\include"
> /I
> "C:\projects\NIH2009\source\branches\trunk\source\cpp\app\testing\dicomserver\include"
> /I
> "C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\CUDA_Toolkit_2.2\include"
> /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS"
> /Gm /EHsc /RTC1 /MTd /Fo"dvipdicomsvr.dir\Debug\\"
> /Fd"C:/projects/NIH2009/source/branches/trunk/build/Windows-6.1/ouput/bin/Debug/dvipdicomsvr.pdb"
> /W3 /c /Zi /TP /Zm1000
> "..\..\..\..\..\source\cpp\app\testing\dicomserver\src\main.cpp"
> "..\..\..\..\..\source\cpp\app\testing\dicomserver\src\dcmtksvr.cpp" ]
>
> include:
>
>
> C:\projects\NIH2009\source\branches\trunk\source\cpp\app\testing\dicomserver\include
>
> Why?
>
>
Unfortunately, just "CMake 101" here...

The answer is fairly close to the top of the FAQ:
http://www.cmake.org/Wiki/CMake_FAQ#Why_does_CMake_use_full_paths.2C_or_can_I_copy_my_build_tree.3F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100202/5eb21f86/attachment-0001.htm>


More information about the CMake mailing list