Package: cmake-data
Version: 2.8.12.1-1.1
Severity: normal
Tags: patch

Andrew Kelly noticed that if one uses GNUInstallDirs to obtain the
library location, libraries will be installed into
/usr/local/lib/$triplet with the default prefix. However, ld.so is not
configured to look for libraries there. I think that GNUInstallDirs
should point to multiarch locations only if the location is really known
to be considered by ld.so. In the case of Debian, this is only the case
if the prefix is / or /usr.

What do you think of the attached patch? It adds the multiarch triplet
if and only if prefix is / or /usr.

Regards
-- 
Sebastian Ramacher
Description: Do not install libs into multiarch location if prefix is different
 from / and /usr.
 .
 The default configuration of ld.so does not include any multiarch locations in
 /usr/local. Only / and /usr have multiarch locations configured. Therefore, if
 the prefix is not / or /usr, the default library install location should be
 "lib".
Author: Sebatian Ramacher <sramac...@debian.org>
Last-Update: 2014-02-23

--- cmake-2.8.12.1.orig/Modules/GNUInstallDirs.cmake
+++ cmake-2.8.12.1/Modules/GNUInstallDirs.cmake
@@ -81,9 +81,11 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
   if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
       AND NOT CMAKE_CROSSCOMPILING)
     if (EXISTS "/etc/debian_version") # is this a debian system ?
-       if(CMAKE_LIBRARY_ARCHITECTURE)
-         set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
-       endif()
+      if (CMAKE_INSTALL_PREFIX STREQUAL "/" OR CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+        if(CMAKE_LIBRARY_ARCHITECTURE)
+          set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+        endif()
+      endif()
     else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
       if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
         message(AUTHOR_WARNING

Attachment: signature.asc
Description: Digital signature

Reply via email to