[cmake-developers] [Review Request] Topic CMakePackageConfigHelpers_build_tree

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Wed Jul 16 11:55:17 EDT 2014


Hello all,

Please review the topic CMakePackageConfigHelpers_build_tree.


This patch adds an option BUILD_TREE to configure_package_config_file.

At the moment it is complicated to generate config files both for
install and build tree, usually combined with "export(TARGETS)" and
"install(EXPORT)", using configure_package_config_file, and it will
require to tweak the build tree variables to always use absolute paths,
or the generated config file will be broken.

You can generate valid config files, but in the build tree the relative
paths will always be calculated compared to CMAKE_INSTALL_PREFIX, and
this does not make sense, and also generates config files with very long
lists of "../../../" and difficult to read.

The BUILD_TREE option instructs configure_package_config_file to
consider paths that are not absolute as relative to the CMAKE_BINARY_DIR
directory instead of relative to the CMAKE_INSTALL_PREFIX` directory.

This makes a lot easier to generate 2 different config files, one for
the build directory and one to install with the package.


* CMakePackageConfigHelpers: Remove unused variable:
  http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=7d7bb039

* CMakePackageConfigHelpers: restructure documentation and document
  commands:
  http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=a8e70768

* CMakePackageConfigHelpers: Add BUILD_TREE option:
  http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=d64849af

* CMakePackageConfigHelpers: Add unit tests for BUILD_TREE option:
  http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=3d3695ca



Cheers,
 Daniele



More information about the cmake-developers mailing list