Bug #1125

CMake: does not support overriding/selecting correct libdir (lib64)

Added by Michał Górny almost 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:04 Oct 2015
Priority:NormalDue date:
Assignee:Robin Mills% Done:

100%

Category:buildEstimated time:1.00 hour
Target version:0.26

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

Revision 3977
Added by Robin Mills almost 2 years ago

#1125. Thank You to Michał for reporting and providing the patch.

History

#1 Updated by Robin Mills almost 2 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.

#2 Updated by Michał Górny almost 2 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.

#3 Updated by Robin Mills almost 2 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_LIBDIR
in 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.

#4 Updated by Robin Mills almost 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
  • Estimated time set to 1.00

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).

#5 Updated by Michał Górny almost 2 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)

#6 Updated by Robin Mills almost 2 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.

#7 Updated by Michał Górny almost 2 years ago

I've already talked to him and he doesn't mind that. Just wanted to make things clear.

#8 Updated by Robin Mills almost 2 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.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux