multiple pathes in cmake variables

Ralf Habacker ralf.habacker at freenet.de
Sat Feb 11 11:14:03 CET 2006


Brad King schrieb:
> Ralf Habacker wrote:
>   
>> Hi,
>>
>> kdewin32 requires two additional pathes to include. I have tried
>>
>> KDEWIN32_INCLUDE_DIR:PATH=c:\daten\kde4\kdelibs\win\include;c:\daten\kde4\kdelibs\win\include\mingw;
>>
>> but this results into an error.
>>
>> C:\Daten\kde4\CMake\bin\cmake.exe -E cmake_depends  "MinGW Makefiles" 
>> C:\Daten\kde4\kdelibs C:\Daten\kde4\kdelibs\dcop C:\Daten\kde4\kde
>> \dcop\CMakeFiles\DCOP.dir\DependInfo.cmake
>> CMake Error: Invalid escape sequence \d
>>     
>
> Use forward slashes for paths in CMake code:
>
> cmake . 
> "-DKDEWIN32_INCLUDE_DIR:PATH=c:/daten/kde4/kdelibs/win/include;c:/daten/kde4/kdelibs/win/include/mingw"
>
>   
There seems a bug in cmake.  In cmake/modules/FindlibXML2 the following 
config is required to detect libxml2 

FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
  ${CMAKE_INCLUDE_PATH}/libxml2
  ${_LibXml2IncDir}/libxml2
  /usr/include/libxml2
  /usr/local/include/libxml2
)

using

cmake -DCMAKE_INCLUDE_PATH:PATH=c:\gnuwin32\include

If more than one path is used in CMAKE_INCLUDE_PATH this detection will 
fail.

cmake -DCMAKE_INCLUDE_PATH:PATH=c:\gnuwin32\include;c:\xyz\include

the FIND_PATH function tried to find the include file libxml/xpath.h in 
"c:\gnuwin32\include;c:\xyz\include/libxml2" which fails as one path and 
not as  in c:\gnuwin32\include/libxml2 and c:\xyz\include/libxml2 expected.

That means that multiple pathes in a variable and concatenation of 
additional subdirs dot not work in the FIND_PATH function or is there an 
alternative syntax to fix this problem ?

Someone may say, that in this case

cmake 
-DCMAKE_INCLUDE_PATH:PATH=c:\gnuwin32\include;c:\gnuwin32\include\libxml2

should be used but this seems to me not very good, because for every 
external package a specific look on the required include path is  
required, where the main include path in this case c:\gnuwin32\include 
would be the only required path.


Ralf




More information about the Kde-buildsystem mailing list