Fix find_library() to find libraries in multiarch library paths.

While the patch is not a good fix (hackish by nature, no cross-compilation
support etc.), it should do the job in majority of cases. Also require dpkg-dev
>= 1.16 at both build time (Build-Depends) and runtime (cmake Depends) because
the patch needs dpkg-architecture -qDEB_HOST_MULTIARCH. (Closes: #618932)

Implemented in multiarch_library_directory_hack.diff.
ci/unstable
Modestas Vainius 14 years ago
parent 497d3f1c08
commit 3220ba5539

6
debian/changelog vendored

@ -9,6 +9,12 @@ cmake (2.8.4+dfsg.1-3) UNRELEASED; urgency=low
in Build-Depends. libxmlrpc-c3-dev has become a transitional package.
* Bump Standards-Version to 3.9.2: no changes needed.
* Switch Vcs-* debian/control fields to anonscm.debian.org.
* Fix find_library() to find libraries in multiarch library paths (patch
multiarch_library_directory_hack.diff). While the patch is not a good fix
(hackish by nature, no cross-compilation support etc.), it should do the
job in majority of cases. Also require dpkg-dev >= 1.16 at both build
time (Build-Depends) and runtime (cmake Depends) because the patch needs
dpkg-architecture -qDEB_HOST_MULTIARCH. (Closes: #618932)
-- Modestas Vainius <modax@debian.org> Fri, 04 Mar 2011 22:38:25 +0200

5
debian/control vendored

@ -3,7 +3,7 @@ Section: devel
Priority: optional
Maintainer: Modestas Vainius <modax@debian.org>
Uploaders: A. Maitland Bottoms <bottoms@debian.org>, Kai Wasserbäch <curan@debian.org>
Build-Depends: debhelper (>= 8), libcurl4-gnutls-dev, libexpat1-dev, zlib1g-dev,
Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.16), libcurl4-gnutls-dev, libexpat1-dev, zlib1g-dev,
libncurses5-dev, libqt4-dev (>= 4.4.0), procps [!hurd-any], libarchive-dev (>= 2.8.0),
libxmlrpc-core-c3-dev | libxmlrpc-c3-dev
Standards-Version: 3.9.2
@ -13,7 +13,8 @@ Homepage: http://cmake.org/
Package: cmake
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, cmake-data (= ${source:Version}), procps [!hurd-any]
Depends: ${shlibs:Depends}, ${misc:Depends}, cmake-data (= ${source:Version}),
dpkg-dev (>= 1.16), procps [!hurd-any]
Suggests: gcc, make
Description: cross-platform, open-source make system
CMake is used to control the software compilation process using

@ -0,0 +1,52 @@
From: Jonathan Riddell <jriddell@ubuntu.com>
Subject: Add multiarch lib path support to find_library() (HACK)
Bug: http://public.kitware.com/Bug/view.php?id=12037
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618932
Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/cmake/+bug/737137
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=ubuntu_multiarch_library_directory.diff;att=1;bug=618932
Forwarded: yes
Acked-By: Modestas Vainius <modax@debian.org>
Last-Update: 2011-06-07
This is the same as ubuntu_multiarch_library_directory.diff in Ubuntu packages.
I do not consider this patch to be a proper fix but rather hack-level stuff.
It does not support cross-compilation or find_package() etc. However, the lack
of better solution at the right time forced me to include it. Hopefully, it's
temporary.
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -29,6 +29,8 @@ SET(UNIX 1)
GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+EXECUTE_PROCESS(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH OUTPUT_VARIABLE CMAKE_ARCH_TRIPLET OUTPUT_STRIP_TRAILING_WHITESPACE)
+
# List common installation prefixes. These will be used for all
# search types.
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
@@ -74,6 +76,7 @@ LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
)
LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+ /lib/${CMAKE_ARCH_TRIPLET} /usr/lib/${CMAKE_ARCH_TRIPLET}
/lib /usr/lib /usr/lib32 /usr/lib64
)
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -346,6 +346,14 @@ void cmFindBase::AddPrefixPaths(std::vec
{
dir += "/";
}
+ if (subdir == "lib")
+ {
+ const char* triplet = this->Makefile->GetDefinition("CMAKE_ARCH_TRIPLET");
+ if (triplet)
+ {
+ this->AddPathInternal(dir+"lib/"+triplet, pathType);
+ }
+ }
std::string add = dir + subdir;
if(add != "/")
{

@ -2,3 +2,4 @@ fixup_manpages.diff
FindBoost_add_-lpthread_#563479.diff
backport_test_order_fix.diff
screen-256color-bce.diff
multiarch_library_directory_hack.diff

Loading…
Cancel
Save