From: Dominik Schmidt Date: Thu, 14 Jun 2018 19:49:07 +0000 (+0200) Subject: Install libocsync to lib/ without subfolder. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~570 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aad928a6befa13753911bd357d26191d978e1539;p=nextcloud-desktop.git Install libocsync to lib/ without subfolder. Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of irritations in the past and subtle annoying to fix bugs. To avoid name clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now part of the filename instead of the subfolder. The concrete motivation to change this now is that on Windows there is no RPATH and it's not possible to run owncloud directly from the Craft Root folder, which is nice when you're developing on Windows. It would have been possible to change this just for Windows but as written earlier this has caused lots of issues and thus I think it's a good idea to just stay consistent accross platforms when touching it. --- diff --git a/cmake/modules/NSIS.template.in b/cmake/modules/NSIS.template.in index 8fff6e196..dc68d745b 100644 --- a/cmake/modules/NSIS.template.in +++ b/cmake/modules/NSIS.template.in @@ -389,7 +389,8 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}" File "${BUILD_PATH}\bin\${APPLICATION_CMD_EXECUTABLE}" File "${BUILD_PATH}\bin\lib${APPLICATION_SHORTNAME}sync.dll" - File "${BUILD_PATH}\bin\libocsync.dll" + ; Yes, with @ ... ${APPLICATION_EXECUTABLE} contains the .exe extension, @APPLICATION_EXECUTABLE@ does not. + File "${BUILD_PATH}\bin\libocsync_@APPLICATION_EXECUTABLE@.dll" File "${BUILD_PATH}\src\gui\client*.qm" ; Make sure only to copy qt, not qt_help, etc diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index abb36205f..47774c987 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -20,13 +20,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") endif() if(NOT BUILD_LIBRARIES_ONLY) - add_executable(${cmd_NAME} ${cmd_SRC}) - set_target_properties(${cmd_NAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} ) - set_target_properties(${cmd_NAME} PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" ) + add_executable(${cmd_NAME} ${cmd_SRC}) + set_target_properties(${cmd_NAME} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} ) - target_link_libraries(${cmd_NAME} ocsync ${synclib_NAME} Qt5::Core Qt5::Network) + target_link_libraries(${cmd_NAME} ocsync_${APPLICATION_EXECUTABLE} ${synclib_NAME} Qt5::Core Qt5::Network) # Need tokenizer for netrc parser target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer) diff --git a/src/crashreporter/CMakeLists.txt b/src/crashreporter/CMakeLists.txt index eb68418dc..b135c4ed2 100644 --- a/src/crashreporter/CMakeLists.txt +++ b/src/crashreporter/CMakeLists.txt @@ -29,7 +29,6 @@ if(NOT BUILD_LIBRARIES_ONLY) target_include_directories(${CRASHREPORTER_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) 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}" ) target_link_libraries(${CRASHREPORTER_EXECUTABLE} crashreporter-gui Qt5::Core Qt5::Widgets diff --git a/src/csync/CMakeLists.txt b/src/csync/CMakeLists.txt index 26d66e655..a2ed3e2f3 100644 --- a/src/csync/CMakeLists.txt +++ b/src/csync/CMakeLists.txt @@ -69,7 +69,7 @@ endif() configure_file(csync_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/csync_version.h) -set(CSYNC_LIBRARY ocsync) +set(CSYNC_LIBRARY "ocsync_${APPLICATION_EXECUTABLE}") add_library(${CSYNC_LIBRARY} SHARED ${common_SOURCES} ${csync_SRCS}) target_include_directories( @@ -135,11 +135,11 @@ else() TARGETS ${CSYNC_LIBRARY} LIBRARY DESTINATION - ${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE} + ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION - ${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE} + ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION - ${CMAKE_INSTALL_BINDIR}/${APPLICATION_EXECUTABLE} + ${CMAKE_INSTALL_BINDIR} ) endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index d16b77097..701873838 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -324,9 +324,6 @@ endif() set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES 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 - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" ) target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::GuiPrivate Qt5::Svg Qt5::Network Qt5::Xml Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::WebEngineWidgets) target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} ) diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index 648214da1..2ac92fba0 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -94,7 +94,7 @@ ENDIF(NOT APPLE) add_library(${synclib_NAME} SHARED ${libsync_SRCS}) target_link_libraries(${synclib_NAME} - ocsync + ocsync_${APPLICATION_EXECUTABLE} OpenSSL::Crypto OpenSSL::SSL ${OS_SPECIFIC_LINK_LIBRARIES} @@ -127,8 +127,6 @@ set_target_properties( ${synclib_NAME} PROPERTIES SOVERSION ${MIRALL_SOVERSION} RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} ) -set_target_properties( ${synclib_NAME} PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" ) if(NOT BUILD_OWNCLOUD_OSX_BUNDLE) install(TARGETS ${synclib_NAME} diff --git a/test/csync/CMakeLists.txt b/test/csync/CMakeLists.txt index a7ec9f133..d75361b02 100644 --- a/test/csync/CMakeLists.txt +++ b/test/csync/CMakeLists.txt @@ -13,7 +13,7 @@ include_directories(${CHECK_INCLUDE_DIRS}) add_library(${TORTURE_LIBRARY} STATIC torture.c cmdline.c) target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARIES} ${CSYNC_LIBRARY}) -set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt5::Core ocsync) +set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt5::Core ocsync_${APPLICATION_EXECUTABLE}) # create tests