View Issue Details [ Jump to Notes ] | [ Print ] |
ID | Project | Category | View Status | Date Submitted | Last Update |
0012254 | CMake | CMake | public | 2011-06-07 15:48 | 2011-06-08 08:19 |
|
Reporter | Mikael Öhman | |
Assigned To | | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | duplicate | |
Platform | Linux | OS | Debian | OS Version | Sid |
Product Version | CMake-2-8 | |
Target Version | | Fixed in Version | | |
|
Summary | 0012254: Hardcoded CMAKE_SYSTEM_LIBRARY_PATH is no good. |
Description | The find_library function fails to find libraries not installed in the standard.
And old mailing list entry explained it well.
http://www.cmake.org/pipermail/cmake/2010-January/034747.html [^]
I implemented the recursive checking of ld.so.conf, which fixed the problems for me, and gives CMake a correct behavior on Linux systems.
|
Steps To Reproduce | 1. Using Debian Sid. New version of glibc places libraries in /usr/lib/x86_64-linux-gnu/ which is overlooked by find_library
2. Configure with CMake and FindMPI will fail to find many libraries such as libld.so, libnsl.so etc.
|
Tags | No tags attached. |
|
Attached Files | UnixPaths.patch [^] (878 bytes) 2011-06-07 15:48 [Show Content] [Hide Content]diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 5ee7ddb..5200f9d 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -56,6 +56,25 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
/usr/openwin/include
)
+MACRO(APPEND_LD_SO_CONF conffile)
+ FILE(STRINGS ${conffile} ldpaths)
+ FOREACH(val ${ldpaths})
+ IF(NOT val MATCHES "#.*|^ *$")
+ IF(val MATCHES "include .*")
+ STRING(SUBSTRING ${val} 8 -1 includeglob)
+ FILE(GLOB includefiles ${includeglob})
+ FOREACH(ifile ${includefiles})
+ APPEND_LD_SO_CONF(${ifile})
+ ENDFOREACH()
+ ELSE()
+ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${val})
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO()
+
+APPEND_LD_SO_CONF("/etc/ld.so.conf")
+
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
# Windows API on Cygwin
/usr/lib/w32api
|
|