[CMake] GNUInstallDir for CMake export files

Nils Gladitz nilsgladitz at gmail.com
Wed Oct 1 05:13:57 EDT 2014


On 01.10.2014 00:26, Nico Schlömer wrote:
> into which of the directories listed in [1] are the CMake export files
> (*Config.cmake, *Target.cmake,...) supposed to go?

On [2] scroll down to "CMake constructs a set of possible installation 
prefixes for the package.".

Any of the listed (W) or (U) conventions will work.

My Qt5 installation (Ubuntu) for example seems to follow the first of 
the listed unix (U) conventions:
     <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/

Resulting in e.g.:
     /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake

That corresponds to "${CMAKE_INSTALL_LIBDIR}/cmake/Qt5" which for the 
default install prefix (/usr/local) expands to:
     "lib/cmake/Qt5"

For CMAKE_INSTALL_PREFIX "/usr" it expands to:
     "lib/x86_64-linux-gnu/cmake/Qt5"

Nils

[1] http://www.cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
[2] http://www.cmake.org/cmake/help/v3.0/command/find_package.html



More information about the CMake mailing list