In the answer to this question:
Where should cmake files be installed?
we learn that, among other places, it is "acceptable" (in terms of CMake's search patterns) to install .cmake
files under <prefix>/share/
(perhaps in additional subdirs within) or to <prefix>/lib/cmake
.
Now, on the one hand, the accepted answer there suggests a preference for <prefix>/lib/cmake
; but on the other hand, CMake itself, as bundled by most (?) Linux distributions, places its .cmake
files under /usr/share/cmake
.
So which option is preferable? Or rather, which is the most commonly-used to your knowledge?
PS - If you use GNUInstallDirs
, the choice is between ${CMAKE_INSTALL_LIBDIR}/cmake
vs ${CMAKE_INSTALL_DATADIR}/cmake
, which is perhaps more multi-platformy.