Hi,

> I am guessing that
> you're putting the detection for every library that your app can/must use
> into one "find" module, when you actually probably should have a directory
> in your source tree added to your CMAKE_MODULE_PATH that contains a large
> number of find modules, some of which are interdependent (just like how the
> example I sent uses find_package(BLAS) - which is a module that comes
> bundled with cmake).

-- Exactly!

I'm thinking now that this is indeed a good solution: Writing
*separate* FindLibraryX.cmake files for all the libraries included in
MyPackage and putting all the dependency information in there; then,
make a meta .cmake file which will allow for specifying the keyword
COMPONENTS, and where all the meta information goes (e.g., version
number of MyPackage).

Minor drawbacks of this approach I find would be that the fact that
all those libraries live under one roof is entirely discarded, that
is, that they all share a common LIB directory, INCLUDE directory, all
have the same version string (namely the one of MyPackage). Plus also,
new libraries included require their own new FindNewLib.cmake to be
created, while all FindLibrary*.cmake would actually be the same file,
except for the dependency info (nasty (?) code duplication).

How I came to think about COMPONENTS in the first place was looking at
FindBoost.cmake which I *thought does what I'm doing -- except for the
intercomponent linking info.

Cheers!
Nico
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to