cmake: How to use check_something() macros with non-standard locations, Was: Re: invitation: try compiling kdelibs using cmake

Alexander Neundorf neundorf at kde.org
Wed Feb 1 19:52:35 CET 2006


Hi,

On Saturday 28 January 2006 00:26, Brad King wrote:
> William A. Hoffman wrote:
> > At 04:30 PM 1/27/2006, Benjamin Reed wrote:
> >>On 1/27/06, William A. Hoffman <billlist at nycap.rr.com> wrote:
> >>>There are currently environment variables for this:
> >>>
> >>>CMAKE_LIBRARY_PATH
> >>>CMAKE_INCLUDE_PATH
> >>
> >>in what order are these searched?  When I run:
> >>
> >> cmake -DCMAKE_INCLUDE_PATH:string=/sw/include \
> >>   -DCMAKE_LIBRARY_PATH:string=/sw/lib .
> >
> > Those have to be shell environment variables, and not cmake variables.
> > (CMAKE_INCLUDE_PATH=/sw/include cmake .) should work.
>
> Since paths specified on the command line like Ben's first attempt
> should probably take the highest priority I have now generalized the
> path ordering a bit.  Paths are now searched like this for libraries:
>
> 1.) Paths listed in the CMAKE_LIBRARY_PATH variable in the cache.
> 2.) Paths listed in the CMAKE_LIBRARY_PATH environment variable.
> 3.) Paths listed in the LIB environment variable.
> 4.) Paths listed in the call to the FIND_LIBRARY command.
> 5.) Paths listed in the PATH environment variable (useful for DLLs on
> windows).
>
> and for include files:
>
> 1.) Paths listed in the CMAKE_INCLUDE_PATH variable in the cache.
> 2.) Paths listed in the CMAKE_INCLUDE_PATH environment variable.
> 3.) Paths listed in the INCLUDE environment variable.
> 4.) Paths listed in the call to the FIND_PATH command.
>
> This order IMO is most-specific to least-specific for a particular
> system, project, user, and build tree.

These variables are used for the find_xxx() commands, right ?
Is there a way to set additional directories for the check_something_exists() 
macros ? (except of setting a special variable for each of the checks, more 
like a global variable which will be used for everything).
The problem is that there are a lot of configure checks in 
kdelibs/ConfigureChecks.cmake. On windows most of them will fail, *except* 
they find the stuff which is either located in kdelibs/win/include/ or, 
probably the better way, the stuff from kdelibs/win/, but already installed 
somewhere.
I guess setting the environment variables for the include and link dir of the 
compiler is recommended ?

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


More information about the Kde-buildsystem mailing list