Install CMake config to LIBDIR by default, to correctly support multiarch #3849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using
share/cmake/${PROJECT_NAME}
asDESTINATION
for installingZeroMQConfig.cmake
et al works for arch-independent configs (like cppzmq's header-only package), but is wrong for arch-dependent packages when installed on multiarch systems.The
...Config.cmake
file is the library interface definition, and in arch-dependent multiarch builds is specific to the architecture currently being built. Each build of a library should have its interface installed below the arch-dependent LIBDIR.This PR sets the default
ZEROMQ_CMAKECONFIG_INSTALL_DIR
to"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
, using the GNUInstallDirs${CMAKE_INSTALL_LIBDIR}
variable to target the correct arch-dependent dir.See e.g. Daniel Pfeifer's "Effective CMake" (PDF of slides from CPPNow 2017), though he doesn't use GNUInstallDirs:
Or Pablo Arias' "It's Time To Do CMake Right" post, which does:
Administrative: Relicensing statement included, signoffs in commit messages