[CMake] packaging configuration files

Brad King brad.king at kitware.com
Mon Nov 9 14:00:46 EST 2009


James C. Sutherland wrote:
>> However, I just discovered that this is a deprecated feature, and that
>>     install(EXPORT...)
>> should be used instead.

Good, it is much more modern and more powerful.

>> However, it is not clear to me how to incorporate dependencies when 
>> using the install(EXPORT) approach.  Are we now supposed to do this 
>> manually, or am I missing something?

The myproj-targets.cmake file that install(EXPORT) puts in the
install tree should already have all the dependencies (actually
that file includes a per-configuration file which defines all
the libraries).  See this page for details:

   http://www.cmake.org/Wiki/CMake_2.6_Notes

> I think that I have this figured out now.  I am collecting the library 
> dependencies and shoving them into the Config file that find_package() 
> uses.  This seems to work just fine.

What are you putting in the Config?  Typically the <pkg>Config.cmake
file should just include the file produced by install(EXPORT).

-Brad


More information about the CMake mailing list