[CMake] creating <Package>Config.cmake and the LOCATION property
Brad King
brad.king at kitware.com
Tue Sep 9 15:31:27 EDT 2008
Server Levent Yilmaz wrote:
>
> I have an outdated version of "Mastering CMake" book (for CMake version
> 2.2). Referring to section 6.7 "Creating a <Package>Config.cmake
> file", the configure step contains the following:
>
> GET_TARGET_PROPERTY( GROMIT_LIBRARY Gromit LOCATION )
>
> where Gromit is the library target and GROMIT_LIBRARY is the variable to
> be used by CONFIGURE_FILE( GromitConfig.cmake.in
> <http://GromitConfig.cmake.in> ... ) command. The problem is that the
> LOCATION property is deprecated in CMake 2.6 (see
> http://www.cmake.org/HTML/cmake-2.6.html#prop_tgt:LOCATION ), for
> reasons which seems to exclude this particular use.
>
> So, what is the correct way to create config files for a library project?
A totally new packaging mechanism has been implemented since the book
was printed. It is available in CMake 2.6. The documentation is online
here:
http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_Targets
http://www.cmake.org/Wiki/CMake_2.6_Notes#Packages
-Brad
More information about the CMake
mailing list