1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-05-12 14:34:12 +02:00

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.
This commit is contained in:
Dominik Schmidt 2018-06-14 21:49:07 +02:00 committed by Kevin Ottens
parent 919debccfc
commit aad928a6be
No known key found for this signature in database
GPG Key ID: 074BBBCB8DECC9E2
7 changed files with 12 additions and 19 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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} )

View File

@ -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}

View File

@ -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