Review Request: Attica will not be found if installed under /usr/local/

Alexander Neundorf neundorf at
Tue Sep 21 18:45:04 BST 2010

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
> >     "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)
> 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.


More information about the kde-core-devel mailing list