View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013742CMakeCMakepublic2012-11-26 15:332013-04-17 08:54
ReporterNick Hutchinson 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version12.10
Product VersionCMake 2.8.10.1 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013742: support multiarch include paths for Debian/Ubuntu
DescriptionOn my Ubuntu 12.10 box, headers for libffi are located at /usr/include/i386-linux-gnu/. This means that a simple find_path(FFI_INCLUDE_DIR NAMES ffi.h) won't find the header, as /usr/include/i386-linux-gnu/ is not searched by default. It ought to be; when compiling with either GCC or Clang, this directory is in the default #include search list.
Steps To Reproduce1. On a multiarch system, e.g. Ubuntu, attempt to use find_path() to find an architecture-specific header.

Expected behaviour:
It "just works": CMake searches the appropriate include directory, without requiring the user to add any supplementary search paths, suffixes, and so on. This seems to be the behaviour with find_library(), for example.

Actual behaviour:
CMake fails to find the header.
Additional InformationI'm not sure how robust this is, but I'm currently working around this issue by using the following:

find_file(FFI_INCLUDE_DIR NAMES ffi.h PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE})
TagsNo tags attached.
Attached Filespatch file icon 0001-Teach-find_-path-file-about-Linux-multiarch-13742.patch [^] (2,431 bytes) 2012-11-26 17:07 [Show Content]

 Relationships
related to 0012037closedBrad King support multiarch lib paths for Debian/Ubuntu 

  Notes
(0031717)
Brad King (manager)
2012-11-26 16:18

According to

 http://wiki.debian.org/Multiarch/LibraryPathOverview#Multiarch_and_cross-compilation [^]

there is not yet a standard place for multiarch headers, but page says it was lasted edited on 2011-09-18. I now see /usr/include/<triplet> listed here:

 https://wiki.ubuntu.com/MultiarchCross [^]

Multiarch support was added in find_library here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b41ad3b3 [^]

for issue 0012037. A similar change will be needed for find_path and find_file.
(0031720)
Brad King (manager)
2012-11-26 17:07

Please try attached "0001-Teach-find_-path-file-about-Linux-multiarch-13742.patch".
(0031724)
Brad King (manager)
2012-11-27 08:48

Fixed and test added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b96f6fc2 [^]
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da1d9bac [^]
(0032883)
Robert Maynard (manager)
2013-04-17 08:54

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-11-26 15:33 Nick Hutchinson New Issue
2012-11-26 16:18 Brad King Note Added: 0031717
2012-11-26 16:18 Brad King Relationship added related to 0012037
2012-11-26 16:19 Brad King Target Version => CMake 2.8.11
2012-11-26 16:19 Brad King Summary find_path() ought to pick up architecture-specific headers on multiarch systems => support multiarch include paths for Debian/Ubuntu
2012-11-26 17:07 Brad King Assigned To => Brad King
2012-11-26 17:07 Brad King Status new => assigned
2012-11-26 17:07 Brad King File Added: 0001-Teach-find_-path-file-about-Linux-multiarch-13742.patch
2012-11-26 17:07 Brad King Note Added: 0031720
2012-11-27 08:48 Brad King Note Added: 0031724
2012-11-27 08:48 Brad King Status assigned => resolved
2012-11-27 08:48 Brad King Resolution open => fixed
2012-11-27 08:48 Brad King Fixed in Version => CMake 2.8.11
2013-04-17 08:54 Robert Maynard Note Added: 0032883
2013-04-17 08:54 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team