CMakeLists.txt: Use GNUinstalldirs module #327
Merged
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.
Debian's packger of librime here. This patch would introduce the GNUInstallDirs module into the project's top-level CMakeLists.txt.
GNUInstalldirs is available since CMake 3.0.2. It provides standard install directory variables as defined for GNU software. Using this module would provides standard variable names for bindir, libdir, includedir and datadir, etc., which would be beneficial. There's no needs for manual string concatenation anymore.
This module is especially useful for Debian-based Linux distributions since they are using
/usr/lib/<arch-triplet>/
as libdir instead of/usr/lib/
and/usr/lib64/
. The GNUInstallDirs module can elegantly suit such needs.CMake >= 3.0.2 has been available for many years. It is at least available since Ubuntu 16.04 and Debian 8, which covers all supported Debian and Ubuntu versions (Ubuntu 14.04 LTS has reached End-Of-Life already). As a result, such version bump should not cause much troubles even for users of old systems. I would admit that CMake 3.x is not available on CentOS 7 but at least it is available through epel.
This patch modifies the top-level CMakeLists.txt and applies the standard variables accordingly. The minimal CMake version requirement is also bumped to 3.0.2. I'm wondering if you find it okay to merge it. Thanks!
Edit 1: I see that the currrent Travis CI config still uses Trusty (14.04). I would expect build failures with current settings. Maybe it's time to bump the testbed version?