Bug #1125
CMake: does not support overriding/selecting correct libdir (lib64)
100%
Description
The CMake build system hardcodes 'lib' as installation directory for libraries. This is incorrect on most modern 64-bit systems where the directory should be 'lib64'.
There are two common ways of solving this:
1. using GNUInstallDirs cmake module, and the directories defined by it (${CMAKE_INSTALL_LIBDIR} in particular),
2. defining LIB_SUFFIX or a similar variable, and appending it to hardcoded 'lib'.
An example patch doing the latter can be found in Fedora: http://pkgs.fedoraproject.org/cgit/exiv2.git/tree/exiv2-0.25-cmake_LIB_SUFFIX.patch
Associated revisions
History
Updated by Robin Mills about 6 years ago
- Status changed from New to Assigned
- Assignee set to Robin Mills
- Target version set to 0.26
Thanks for reporting this. I'll investigate and give you an update in the next few days.
Updated by Michał Górny about 6 years ago
Alternatively, here's a patch using GNUInstallDirs that also fixes manpage install: https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/exiv2/files/exiv2-0.25-fix-install-dirs.patch?id=3e09d75a96b8f864847a96daee2e255bda10f0d2
Though for completeness, it should have also used ${CMAKE_INSTALL_BINDIR} for binaries.
Updated by Robin Mills about 6 years ago
Submitted r3977. Thank you Michał for reporting this and providing a patch.
I'm a little surprised that you have commented off:
#SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIRin the topmost CMakeList.txt file. However, I've built this on the Mac (El Capitain) and it passes the test suite. The other changes look fine. I've submitted you complete patch without modification. Thanks very much for working on this.
Updated by Robin Mills about 6 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
- Estimated time set to 1.00 h
I'm setting the status to Resolved/100% and don't intend further work on this. It nothing else arises on this, I'll close this before we ship v0.26 (expected Spring 2016).
Updated by Michał Górny about 6 years ago
I'm sorry that I didn't mention this earlier but the author of the patch is Andreas Sturmlechner, so he deserves the credit for it. (as can be seen on https://gitweb.gentoo.org/repo/gentoo.git/commit/media-gfx/exiv2/files/exiv2-0.25-fix-install-dirs.patch?id=3e09d75a96b8f864847a96daee2e255bda10f0d2)
Updated by Robin Mills about 6 years ago
Thanks for bringing this to my attention. I will email and Thank Andreas for working on this (and copy you). Regrettably, I can't edit the SVN commit message on r3977 as we don't have editing enabled on our SVN server.
Updated by Michał Górny about 6 years ago
I've already talked to him and he doesn't mind that. Just wanted to make things clear.
Updated by Robin Mills about 6 years ago
- Status changed from Resolved to Closed
I'm going to set the status of this to closed. It has been 100% resolved for some time without further incident.
#1125. Thank You to Michał for reporting and providing the patch.