LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File nextcloud-client-fix-rpath.patch of Package nextcloud-client (Project home:ecsos)

--- a/client/src/cmd/CMakeLists.txt
+++ b/client/src/cmd/CMakeLists.txt
@@ -25,8 +25,13 @@ if(NOT BUILD_LIBRARIES_ONLY)
 	qt5_use_modules(${cmd_NAME} Network Sql)
 	set_target_properties(${cmd_NAME} PROPERTIES
 	        RUNTIME_OUTPUT_DIRECTORY  ${BIN_OUTPUT_DIRECTORY} )
-        set_target_properties(${cmd_NAME} PROPERTIES
+        if(LIB_INSTALL_DIR MATCHES "^/")
+          set_target_properties(${cmd_NAME} PROPERTIES
+		INSTALL_RPATH "${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+        else(LIB_INSTALL_DIR MATCHES "^/")
+          set_target_properties(${cmd_NAME} PROPERTIES
 		INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+        endif()
 
 	target_link_libraries(${cmd_NAME} ${synclib_NAME})
 endif()
--- a/client/src/crashreporter/CMakeLists.txt
+++ b/client/src/crashreporter/CMakeLists.txt
@@ -36,7 +36,11 @@ if(NOT BUILD_LIBRARIES_ONLY)
 
     set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON)
     set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY  ${BIN_OUTPUT_DIRECTORY} )
-    set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+    if(LIB_INSTALL_DIR MATCHES "^/")
+      set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES INSTALL_RPATH "${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+    else(LIB_INSTALL_DIR MATCHES "^/")
+      set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+    endif()
     target_link_libraries(${CRASHREPORTER_EXECUTABLE}
         crashreporter-gui
         ${QT_LIBRARIES}
--- a/client/src/gui/CMakeLists.txt
+++ b/client/src/gui/CMakeLists.txt
@@ -282,8 +282,13 @@ set_target_properties( ${APPLICATION_EXE
         RUNTIME_OUTPUT_DIRECTORY  ${BIN_OUTPUT_DIRECTORY}
 )
 # Only relevant for Linux? On OS X it by default properly checks in the bundle directory next to the exe
-set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
+if(LIB_INSTALL_DIR MATCHES "^/")
+  set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
+	INSTALL_RPATH "${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+else(LIB_INSTALL_DIR MATCHES "^/")
+  set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
 	INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+endif()
 
 target_link_libraries( ${APPLICATION_EXECUTABLE} ${QT_LIBRARIES} )
 target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
--- a/client/src/libsync/CMakeLists.txt
+++ b/client/src/libsync/CMakeLists.txt
@@ -147,8 +147,13 @@ set_target_properties( ${synclib_NAME}
 	SOVERSION ${MIRALL_SOVERSION}
 	RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
 )
-set_target_properties( ${synclib_NAME} PROPERTIES
+if(LIB_INSTALL_DIR MATCHES "^/")
+  set_target_properties( ${synclib_NAME} PROPERTIES
+	INSTALL_RPATH "${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+else(LIB_INSTALL_DIR MATCHES "^/")
+  set_target_properties( ${synclib_NAME} PROPERTIES
 	INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
+endif()
 
 target_link_libraries(${synclib_NAME} ${libsync_LINK_TARGETS} )