Project

General

Profile

Bug #1125

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

Added by Michał Górny about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build
Target version:
Start date:
04 Oct 2015
Due date:
% Done:

100%

Estimated time:
1.00 h

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 (diff)
Added by Robin Mills about 6 years ago

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

History

#1

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.

#2

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.

#3

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

#5

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)

#6

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.

#7

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.

#8

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.

Also available in: Atom PDF