Skip to content

Commit 79ef892

Browse files
committedJun 20, 2018
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.
1 parent 464c1fb commit 79ef892

File tree

7 files changed

+12
-19
lines changed

7 files changed

+12
-19
lines changed
 

‎cmake/modules/NSIS.template.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
389389
File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}"
390390
File "${BUILD_PATH}\bin\${APPLICATION_CMD_EXECUTABLE}"
391391
File "${BUILD_PATH}\bin\lib${APPLICATION_SHORTNAME}sync.dll"
392-
File "${BUILD_PATH}\bin\libocsync.dll"
392+
; Yes, with @ ... ${APPLICATION_EXECUTABLE} contains the .exe extension, @APPLICATION_EXECUTABLE@ does not.
393+
File "${BUILD_PATH}\bin\libocsync_@APPLICATION_EXECUTABLE@.dll"
393394

394395
File "${BUILD_PATH}\src\gui\client*.qm"
395396
; Make sure only to copy qt, not qt_help, etc

‎src/cmd/CMakeLists.txt

+4-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ if(UNIX AND NOT APPLE)
1616
endif()
1717

1818
if(NOT BUILD_LIBRARIES_ONLY)
19-
add_executable(${cmd_NAME} ${cmd_SRC})
20-
set_target_properties(${cmd_NAME} PROPERTIES
21-
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
22-
set_target_properties(${cmd_NAME} PROPERTIES
23-
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
19+
add_executable(${cmd_NAME} ${cmd_SRC})
20+
set_target_properties(${cmd_NAME} PROPERTIES
21+
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
2422

25-
target_link_libraries(${cmd_NAME} ocsync ${synclib_NAME} Qt5::Core Qt5::Network)
23+
target_link_libraries(${cmd_NAME} ocsync_${APPLICATION_EXECUTABLE} ${synclib_NAME} Qt5::Core Qt5::Network)
2624

2725
# Need tokenizer for netrc parser
2826
target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer)

‎src/crashreporter/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ if(NOT BUILD_LIBRARIES_ONLY)
4545
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON)
4646
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTORCC ON)
4747
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
48-
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}" )
4948
target_link_libraries(${CRASHREPORTER_EXECUTABLE}
5049
crashreporter-gui
5150
Qt5::Core Qt5::Widgets

‎src/csync/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ endif()
6969

7070
configure_file(csync_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/csync_version.h)
7171

72-
set(CSYNC_LIBRARY ocsync)
72+
set(CSYNC_LIBRARY "ocsync_${APPLICATION_EXECUTABLE}")
7373
add_library(${CSYNC_LIBRARY} SHARED ${common_SOURCES} ${csync_SRCS})
7474

7575
target_include_directories(
@@ -135,11 +135,11 @@ else()
135135
TARGETS
136136
${CSYNC_LIBRARY}
137137
LIBRARY DESTINATION
138-
${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE}
138+
${CMAKE_INSTALL_LIBDIR}
139139
ARCHIVE DESTINATION
140-
${CMAKE_INSTALL_LIBDIR}/${APPLICATION_EXECUTABLE}
140+
${CMAKE_INSTALL_LIBDIR}
141141
RUNTIME DESTINATION
142-
${CMAKE_INSTALL_BINDIR}/${APPLICATION_EXECUTABLE}
142+
${CMAKE_INSTALL_BINDIR}
143143
)
144144
endif()
145145

‎src/gui/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
274274
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
275275
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
276276
)
277-
# Only relevant for Linux? On OS X it by default properly checks in the bundle directory next to the exe
278-
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
279-
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
280277

281278
target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::Network Qt5::Xml)
282279
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )

‎src/libsync/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ENDIF(NOT APPLE)
9090

9191
add_library(${synclib_NAME} SHARED ${libsync_SRCS})
9292
target_link_libraries(${synclib_NAME}
93-
ocsync
93+
ocsync_${APPLICATION_EXECUTABLE}
9494
${OS_SPECIFIC_LINK_LIBRARIES}
9595
Qt5::Core Qt5::Network
9696
)
@@ -122,8 +122,6 @@ set_target_properties( ${synclib_NAME} PROPERTIES
122122
SOVERSION ${MIRALL_SOVERSION}
123123
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
124124
)
125-
set_target_properties( ${synclib_NAME} PROPERTIES
126-
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
127125

128126
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
129127
install(TARGETS ${synclib_NAME}

‎test/csync/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include_directories(${CHECK_INCLUDE_DIRS})
1313
add_library(${TORTURE_LIBRARY} STATIC torture.c cmdline.c)
1414
target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARIES} ${CSYNC_LIBRARY})
1515

16-
set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt5::Core ocsync)
16+
set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt5::Core ocsync_${APPLICATION_EXECUTABLE})
1717

1818
# create tests
1919

0 commit comments

Comments
 (0)
Please sign in to comment.