Hi,

Here is another proposal for patch based on the third case.
   -DCMAKE_LIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH)

This also requires to patch upstream CMakeLists.txt as -DCMAKE_INSTALL_LIBDIR

This time, I did not forget to set $multiarch as you may have already
noticed.  (Previous ones needs to be fixed)

The question is which works across many compile cases including *cross
compile*?  

Here is the background. This is based on http://bugs.debian.org/704812
Also these is anothe case with more info http://bugs.debian.org/635980

    This is the related upstream info page
    
http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Package_Configuration_Files
    http://cmake.org/cmake/help/v2.8.8/cmake.html#command:find_library
    
    | Search paths specified in cmake-specific cache variables. These are
    | intended to be used on the command line with a -DVAR=value.
    |
    |    <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
    |    <prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
    |    CMAKE_LIBRARY_PATH
    |    CMAKE_FRAMEWORK_PATH

Regards,

Osamu

>From 4bb5ca67b77584d7b178a11012fac10cecd86dd5 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Sun, 9 Feb 2014 08:45:07 +0900
Subject: [PATCH] MAKE_LIBRARY_ARCHITECTUR

---
 Debian/Debhelper/Buildsystem/cmake.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Debian/Debhelper/Buildsystem/cmake.pm b/Debian/Debhelper/Buildsystem/cmake.pm
index db971db..4a210bc 100644
--- a/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/Debian/Debhelper/Buildsystem/cmake.pm
@@ -39,9 +39,10 @@ sub new {
 sub configure {
 	my $this=shift;
 	my @flags;
-
+        my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
 	# Standard set of cmake flags
 	push @flags, "-DCMAKE_INSTALL_PREFIX=/usr";
+	push @flags, "-DCMAKE_LIBRARY_ARCHITECTURE=$multiarch";
 	push @flags, "-DCMAKE_VERBOSE_MAKEFILE=ON";
 	push @flags, "-DCMAKE_BUILD_TYPE=None";
 
-- 
1.9.rc1

Reply via email to