[CMake] INSTALL(EXPORT)

Brad King brad.king at kitware.com
Tue Aug 12 19:15:26 EDT 2008


Rupert Brooks wrote:
> 1. Does the name of this file appear in a variable somewhere, so that
> i can use configure file to write it into the ITKConfig.cmake script.
> Previously, there was this
> 
> SET(ITK_LIBRARY_DEPENDS_FILE "@ITK_LIBRARY_DEPENDS_FILE@")
> 
> where ITK_LIBRARY_DEPENDS_FILE is set by the (deprecated)
> EXPORT_LIBRARY_DEPENDENCIES command (as far as i can tell)
> 
> If INSTALL(EXPORT) sets a similar variable, then this change will
> become very easy.

See documentation of the install(EXPORT) command:

http://www.cmake.org/HTML/cmake-2.6.html#command:install

"By default the generated file will be called <export-name>.cmake but 
the FILE option may be used to specify a different name."

A file of that name is installed to the DESTINATION directory given to 
the command.

> 2. The INSTALL(EXPORT) method seems only to generate the dependency
> file when installing.  This precludes just leaving the project in the
> build directory, and pointing a dependent project at that for
> building.  Is this deliberate, or is it hiding the file somewhere I
> cant see it.

There is a separate EXPORT() command for that:

http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_Targets
http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_from_a_Build_Tree

-Brad


More information about the CMake mailing list