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

List:       kde-core-devel
Subject:    Re: Review Request: Attica will not be found if installed under
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2010-09-21 17:45:04
Message-ID: 201009211945.04530.neundorf () kde ! org
[Download RAW message or body]

On Tuesday 21 September 2010, Guy Maurel wrote:
> > On 2010-09-17 18:52:17, Alexander Neundorf wrote:
> > > /usr/local is part of the default search directories, so it should be
> > > found if installed there. I just tested this here locally and it works
> > > for me.
> > >
> > > If it is not found when installed in /usr/local/, then we have to check
> > > what is going wrong there.
> > >
> > > Alex
> >
> > Guy Maurel wrote:
> >     mmmh!
> >     I found at http://www.kitware.com/news/home/browse/168:
> >     "FIND_LIBRARY and FIND_PATH now look in CMAKE_LIBRARY_PATH and
> > CMAKE_INCLUDE_PATH environment variables in addition to and before the
> > PATH environment variable. " It is what I need, but nothing about a
> > default value for CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH Is it
> > something the user *has* to do itself before running?
>
> Thanks to Alex for the discussion and your questions/helps.
>
> The CMAKE_INCLUDE_PATH give the order to search for:
> *First* at /usr/local
> *then*  at /usr
> This is done (I think) to give a priority to the packages one have self
> installed.
>
> At the FindLibAttica.cmake (and other more) there is some lines of code
> such: IF (NOT WIN32)
>    # use pkg-config to get the directories and then use these values
>    # in the FIND_PATH() and FIND_LIBRARY() calls
>    FIND_PACKAGE(PkgConfig)
>    PKG_CHECK_MODULES(PC_LIBATTICA QUIET libattica)
>    SET(LIBATTICA_DEFINITIONS ${PC_ATTICA_CFLAGS_OTHER})
> ENDIF (NOT WIN32)
>
> I am using ArchLinux and the pacman-command installs (implicitly) some
> packages I havn't take care. One of them was "attica", installed at /usr .
> The search order is changed. The cmake works correctly with
> FindLibAttica.cmake and told me: /usr/include .

So you mean that pacman installed a version of attica in /usr, this installed 
attica was reported by pkg-config, and so this version was picked by cmake ?

> *NOW* I would like to ask: What is the reason/strategy of changing the
> search order in this way?

Many people prefer the results of pkg-config over what cmake finds by itself. 
That's why this is the order we have in many find-modules.

I think if you set CMAKE_PREFIX_PATH to /usr/local it should prefer this over 
anything listed in HINTS.

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

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