[CMake] FIND_PACKAGE from another Project

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jun 9 15:45:06 EDT 2008


On Monday 09 June 2008, Horacio Sanson wrote:
> On Mon, Jun 9, 2008 at 7:14 AM, Alexander Neundorf
>
> <a.neundorf-work at gmx.net> wrote:
> > On Friday 06 June 2008, hsanson wrote:
> >>  From the CMake 2.4 documentation I get:
> >>
> >> Directories listed in CMAKE_MODULE_PATH are searched for files called
> >> "Find<name>.cmake". If no such file is found, it is expected that the
> >> package is another project built by CMake that has a
> >> "<name>Config.cmake" file. A cache entry called <name>_DIR is created
> >> and is expected to be set to the directory containing this file.
> >>
> >>
> >> It seems that CMake does not generate this "<name>Config.cmake" file nor
> >> it sets the cache entry <name>_DIR. If this is the case how can I create
> >> the file and the respective cache entry?? and were in my projects
> >> CMakeLists.txt files shall I do it??
>
> What shall I put inside the <name>Config.cmake file?? is there an
> example somewhere??

I think e.g vtk installs such a file.
Also automoc4 installs a very simple one:
http://websvn.kde.org/trunk/kdesupport/automoc/
But this one won't help you a lot.

Which project do you want to use ?
Probably you will want to write a FindFoo.cmake file for it, which will 
contain mostly FIND_LIBRARY() and FIND_PATH() calls.

Alex


More information about the CMake mailing list