[CMake] find_package and lib/cmake/Foo

Biddiscombe, John A. biddisco at cscs.ch
Tue Jul 21 08:53:37 EDT 2015


I've asked this before, but never resolved it...

if I stall package Foo into
CMAKE_INSTALL_PREFIX=/my/path/prefix
and generate
/my/path/prefix/lib/cmake/Foo/FooConfig.cmake
etc

then with
Foo_DIR=/my/path/prefix
Foo_ROOT=/my/path/prefix
find_package(Foo)
does not find package Foo

One needs to set
Foo_DIR=/my/path/prefix/lib/cmake/Foo
or
Foo_ROOT=/my/path/prefix/lib/cmake/Foo

but it specifically states in the documentation http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html "One place it looks is: <prefix>/lib/cmake/Foo*/ where Foo* is a case-insensitive globbing expression"

if I
set(CMAKE_FIND_DEBUG_MODE 1)
then I do not see it searching in my prefix with any extra /lib/cmake/ paths.

Is the documentation wrong, or have I missed something?

thanks

JB


--
John Biddiscombe,                        email:biddisco @.at.@ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  +41 (91) 610.82.82

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150721/b7146545/attachment.html>


More information about the CMake mailing list