[CMake] Confusion on how find_package works.

Robert Dailey rcdailey at gmail.com
Wed Jan 14 13:33:35 EST 2009


On Wed, Jan 14, 2009 at 6:22 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 13.01.09 19:06:13, Robert Dailey wrote:
> > Trust me, I've read this already. It makes no sense to me. How am I
> supposed
> > to know that any of the variables it is checking have been set?
>
> Not sure what you mean wit that. You can check for any cmake variable
> wether its set via if(<variablename>)
>
> > And if so, where were they set?
>
> They are set via the commandline options when running cmake, i.e. cmake
> -DCMAKE_PREFIX_PATH or by setting an environment variable before running
> cmake. I'm not sure how the various CMake GUI's handle this.
>
> > Could someone give me a summary of what find_path is
> > searching in in this specific case?
>
> Check section 4. and 5., both indicate whats used on the platforms to get
> paths which should be checked. 4. mentions PATH and INCLUDE environment
> variables, 5. mentiones platform files for the current system. Those
> informations are usualy found in
> <cmake>/share/cmake-2.6/Modules/Platform/<yourplatform>.cmake, in the case
> of the CMAKE_SYSTEM_PREFIX_PATH variable you'll find the settings in the
> *Paths.cmake files.


I'm trying the following CMake code to setup the search paths for
find_library():

set( search_path ${third_party} )
foreach( i RANGE 4 )
    set( search_path ${search_path}/* )
    list( APPEND CMAKE_INCLUDE_PATH ${search_path} )
    list( APPEND CMAKE_PREFIX_PATH ${search_path} )
endforeach()

However, this isn't working. I'm assuming wildcards work, which is why I am
doing this. I read a thread somewhere on the cmake mailing list that said I
could use wildcards this way. What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090114/d1f344c8/attachment.htm>


More information about the CMake mailing list