multiple pathes in cmake variables
William A. Hoffman
billlist at nycap.rr.com
Sat Feb 11 17:42:05 CET 2006
At 11:38 AM 2/11/2006, Alexander Neundorf wrote:
>On Saturday 11 February 2006 17:32, you wrote:
>...
>> CMAKE_INCLUDE_PATH should NOT be listed in any cmake list file.
>> It is automatically used by find_path see cmFindPathCommand.cxx and
>> cmMakefile::GetIncludeSearchPath. Same thing goes for CMAKE_LIBRARY_PATH.
>
>So instead of
>
>FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
> ${CMAKE_INCLUDE_PATH}/libxml2
> ${_LibXml2IncDir}/libxml2
> /usr/include/libxml2
> /usr/local/include/libxml2
>)
>
>the test should better be like this ?
>
>FIND_PATH(LIBXML2_INCLUDE_DIR libxml2/libxml/xpath.h
> ${_LibXml2IncDir}
> /usr/include
> /usr/local/include
>)
Yes, that looks better. The idea behind CMAKE_INCLUDE_PATH
and CMAKE_LIBRARY_PATH is that they use the same syntax as
the native PATH variable, so for unix :, and windows ; separators.
And, cmake will do the right thing and break up the variables.
CMake first looks for a cmake variable of the name, then the
environment variable are looked at, then the paths specified
in the FIND_* call.
-Bill
More information about the Kde-buildsystem
mailing list