[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    multiple pathes in cmake variables
From:       neundorf () kde ! org (Alexander Neundorf)
Date:       2006-02-11 16:17:40
Message-ID: 200602111717.40932.neundorf () kde ! org
[Download RAW message or body]

Hi,

On Saturday 11 February 2006 11:14, Ralf Habacker wrote:
...
> 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 ?

So the problem is that CMAKE_INCLUDE_PATH is a list and in the case above a 
subdir is appended to it.
This has to be fixed in FindFoo.cmake script, something like this (not tested, 
syntax may be incorrect):

set(allIncDirs)
foreach(incDir ${CMAKE_INCLUDE_PATH})
   set(allIncDirs ${allIncDirs} ${incDir}/libxml2)
endforeach(incDir ${CMAKE_INCLUDE_PATH})

find_path(... ${allIncDirs} ...)

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic