File 0008-so-version_build-cmake-install.patch of Package libght

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84ae81e..46e506f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,8 +36,34 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
 
 if (NOT DEFINED LIB_INSTALL_DIR)
   set (LIB_INSTALL_DIR lib)
+# Override this default 'lib' with 'lib64' if:
+#  - we are on Linux system but NOT cross-compiling
+#  - we are NOT on debian
+#  - we are on a 64 bits system
+# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
+# Note that the future of multi-arch handling may be even
+# more complicated than that: http://wiki.debian.org/Multiarch
+  if(CMAKE_SYSTEM_NAME MATCHES "Linux"
+      AND NOT CMAKE_CROSSCOMPILING
+      AND NOT EXISTS "/etc/debian_version")
+    if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
+      message(AUTHOR_WARNING
+        "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
+        "Please enable at least one language before including GNUInstallDirs.")
+    else()
+      if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+        set(LIB_INSTALL_DIR "lib64")
+      endif()
+    endif()
+  endif()
+  set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}" CACHE PATH "object code libraries (${LIB_INSTALL_DIR})")
 endif()
 
+
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+#SET(CMAKE_MACOSX_RPATH ON)
+
 #------------------------------------------------------------------------------
 # check for headers
 #------------------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c341d38..293dfdb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,6 +34,7 @@ set_target_properties (libght
 		CLEAN_DIRECT_OUTPUT 1
 		DEFINE_SYMBOL GHT_DLL_EXPORT
 		VERSION ${GHT_VERSION}
+		SOVERSION ${GHT_LIB_SOVERSION}
 		CLEAN_DIRECT_OUTPUT 1
 	)
openSUSE Build Service is sponsored by