]> git.mxchange.org Git - simgear.git/commitdiff
#946: some libraries not found on Ubuntu/Debian
authorThorstenB <brehmt@gmail.com>
Sat, 1 Dec 2012 09:59:57 +0000 (10:59 +0100)
committerThorstenB <brehmt@gmail.com>
Sat, 1 Dec 2012 10:00:50 +0000 (11:00 +0100)
Ubuntu/Debian introduced "multiarch" library directories, which is
unsupported by CMake <= 2.8.10. Add manual search paths as a workaround.
Currently it is only needed for libsvn, but it is needed for any lib
which is converted to the new directory standard.

CMakeLists.txt
CMakeModules/FindSvnClient.cmake

index b34f01742edd6c8764f73d9f8cdd4e698af73fb2..f8c5097c118e1f6fa5a533a5b38e02fc818f7ee9 100644 (file)
@@ -68,6 +68,32 @@ else(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
 endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
 message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
 
+#####################################################################################
+# Configure library search paths
+#####################################################################################
+
+if(NOT "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
+    # Workaround for Ubuntu/Debian which introduced the "multiarch" library
+    # directory structure, which is unsupported by CMake < 2.8.10, so we need to
+    # add paths manually
+    # see http://www.cmake.org/Bug/view.php?id=12049 and
+    # http://www.cmake.org/Bug/view.php?id=12037
+    list(APPEND ADDITIONAL_LIBRARY_PATHS
+         /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+         /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+         /lib/${CMAKE_LIBRARY_ARCHITECTURE})
+    message(STATUS "additional library directories: ${ADDITIONAL_LIBRARY_PATHS}")
+endif()
+
+if(NOT MSVC)
+    # TBD: are these really necessary? Aren't they considered by cmake automatically?
+    list(APPEND ADDITIONAL_LIBRARY_PATHS
+         /local
+         /usr/local
+         /usr)
+endif()
+#####################################################################################
+
 if (NOT MSVC)
 option(SIMGEAR_SHARED   "Set to ON to build SimGear as a shared library/framework" OFF)
 option(SYSTEM_EXPAT     "Set to ON to build SimGear using the system libExpat" OFF)
index b176dc29108f3cfa0965ecd83ec50a83bfd15d0c..c7fa89bb218e85662facbb39cbeb64f44403a32d 100644 (file)
@@ -29,10 +29,7 @@ endif(APPLE)
       NAMES ${compLib}
       HINTS $ENV{LIBSVN_DIR} ${CMAKE_INSTALL_PREFIX} ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib
       PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
-      PATHS
-      /opt/local
-      /usr/local
-      /usr
+      PATHS ${ADDITIONAL_LIBRARY_PATHS}
     )
 
        list(APPEND ${libs} ${${compLibName}})