Skip to content

Help: Modernize PackageConfigHelpers example

Frank Dana requested to merge ferdnyc/cmake:gen-pkg-example into master

The example shown in the module documentation for CMakePackageConfigHelpers was showing its age, by:

  1. Hardcoding directory prefixes (etc/, lib/, etc.) instead of using GNUInstallDirs
  2. Handwaving set() commands (incorrectly!) as:
    set(VAR dir/ ... CACHE )
    which should, at the very least, be:
    set(VAR dir/ CACHE ... )
  3. Installing CMake configuration files to lib/Foo/cmake/, when current practice favors ${CMAKE_INSTALL_LIBDIR}/cmake/Foo/

This updated example addresses all of those issues.

Edited by Frank Dana

Merge request reports