On 04/28/2015 11:43 AM, Alan W. Irwin wrote:
@Nils: the origin of the code right below "If COMPONENTS..." is not
clear. Is that code that should be supplied by a package creator or
code that
should be implemented by every find_package user? And if it should be
supplied by a package creator, does the install(EXPORT...) signature
generate that code automatically, does one of the helper functions
that are available generate that code, or do I (as package creator)
have to supply that code some other way?
The package configuration file is normally handwritten (or
handgenerated) by the package creator. I assume you already have one?
e.g. plplotConfig.cmake.
http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages
@Alex: Sorry I missed your reply until now.
@Alex or Nils:
The problem with the URL provided by Nils is only one library is used
in the example so I don't understand exactly what you guys are
suggesting for the multiple library/component case.
For example, are you recommending
install(TARGETS plplot1 EXPORT export_plplot ...)
[...]
install(TARGETS plplotN EXPORT export_plplot ...)
for N installed libraries followed by
install(EXPORT export_plplot DESTINATION ${LIB_DIR}/cmake/plplot)
? That is the current pattern I am using with one overall export name
called "export_plplot". Or would you recommend this different pattern
install(TARGETS plplot1 EXPORT export_plplot1 ...)
install(EXPORT export_plplot1 DESTINATION ${LIB_DIR}/cmake/plplot)
[...]
install(TARGETS plplotN EXPORT export_plplotN ...)
install(EXPORT export_plplotN DESTINATION ${LIB_DIR}/cmake/plplot)
(i.e., N pairs of install(TARGETS...) install(EXPORT...) signatures
with each pair having a unique export name)?
Yes, unique/distinct export names and export files.
That way the target export files can go into the respective distribution
package that they represent.
The "umbrella" package configuration file would be installed by your
"core" package and would then be able to pick up the currently available
target export files.
Nils
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake