multiple pathes in cmake variables

William A. Hoffman billlist at nycap.rr.com
Sat Feb 11 22:29:49 CET 2006


At 04:17 PM 2/11/2006, Alexander Neundorf wrote:
>On Saturday 11 February 2006 21:52, you wrote:
>> Alexander Neundorf schrieb:
>> > On Saturday 11 February 2006 19:48, Alexander Neundorf wrote:
>> >> On Saturday 11 February 2006 19:13, Alexander Neundorf wrote:
>> >>> On Saturday 11 February 2006 18:46, you wrote:
>> >>> ...
>> >>>
>> >>>> Any better way to deal with  like extending FIND_PATH to be able to
>> >>>> handle path lists ?
>> >>>
>> >>> No, I don't think so.
>> >>> I'll fix the FindFoo.cmake files this evening.
>> >>
>> >> I have fixed it locally and am compiling it right now. Once comnpiling
>> >> has finished (usually it takes something like 80 minutes) I'll commit
>> >> it. CMAKE_INCLUDE_PATH will then work as you expect, no need to add
>> >> libxml2/ explicitely to it.
>> >
>> > Ok, committed, please test.
>>
>> Your last commit 508458 does not work as expected, because there is no
>> foreach loop in case more than one path is given with
>> CMAKE_INCLUDE_PATH.  I have commited a working version.
>
>My version should have worked. 
>How does your CMAKE_INCLUDE_PATH look like and where exactly is xpath.h 
>located on your system ?

How about this:

Just have two calls to FIND_PATH:

   FIND_PATH(LIBXML2_INCLUDE_DIR libxml2/libxml/xpath.h ) # this one for windows 
   FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h  # this one for unix
     ${_LibXml2IncDir}
     /usr/include
     /usr/local/include
   )
Then it should find it if is in libxml2 or just include/libxml.
CMAKE_INCLUDE_PATH really should not be referenced in the cmake list file.
The way you have it the environment variable version of CMAKE_INCLUDE_PATH will
not work.  Also, you may have path \ / issues, and the foreach will not work
on unix where ; is not the path separator but : is.


-Bill 



More information about the Kde-buildsystem mailing list