ensure DLL are generated with branded names

cmake distinct runtime and library

on unix dynamic shared libraries are library kind of objects
on windows they are runtime kind of objects

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2021-10-05 11:29:49 +02:00 committed by Matthieu Gallien (Rebase PR Action)
parent f7a34b8bdc
commit c751fd5672
5 changed files with 59 additions and 34 deletions

View file

@ -109,7 +109,9 @@ set_target_properties(
RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY
${BIN_OUTPUT_DIRECTORY} ${BIN_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME
"${APPLICATION_EXECUTABLE}_csync" ${APPLICATION_EXECUTABLE}_csync
RUNTIME_OUTPUT_NAME
${APPLICATION_EXECUTABLE}_csync
) )
if(BUILD_OWNCLOUD_OSX_BUNDLE) if(BUILD_OWNCLOUD_OSX_BUNDLE)
INSTALL( INSTALL(

View file

@ -104,7 +104,7 @@ ENDIF(NOT APPLE)
find_package(Qt5 REQUIRED COMPONENTS WebSockets) find_package(Qt5 REQUIRED COMPONENTS WebSockets)
add_library(nextcloudsync SHARED ${libsync_SRCS}) add_library(nextcloudsync SHARED ${libsync_SRCS})
set_target_properties(nextcloudsync PROPERTIES LIBRARY_OUTPUT_NAME ${APPLICATION_EXECUTABLE}sync)
target_link_libraries(nextcloudsync target_link_libraries(nextcloudsync
PUBLIC PUBLIC
nextcloud_csync nextcloud_csync
@ -135,11 +135,19 @@ GENERATE_EXPORT_HEADER( nextcloudsync
target_include_directories(nextcloudsync PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(nextcloudsync PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(
set_target_properties( nextcloudsync PROPERTIES nextcloudsync
VERSION ${MIRALL_VERSION} PROPERTIES
SOVERSION ${MIRALL_SOVERSION} VERSION
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} ${MIRALL_VERSION}
SOVERSION
${MIRALL_SOVERSION}
RUNTIME_OUTPUT_DIRECTORY
${BIN_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync
RUNTIME_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync
) )
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE) if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)

View file

@ -6,21 +6,26 @@ if (WIN32)
hydrationjob.cpp hydrationjob.cpp
vfs_cfapi.cpp vfs_cfapi.cpp
) )
set_target_properties(nextcloudsync_vfs_cfapi
PROPERTIES
LIBRARY_OUTPUT_NAME ${APPLICATION_EXECUTABLE}sync_vfs_cfapi
)
target_link_libraries(nextcloudsync_vfs_cfapi PRIVATE target_link_libraries(nextcloudsync_vfs_cfapi PRIVATE
nextcloudsync nextcloudsync
cldapi cldapi
) )
set_target_properties("nextcloudsync_vfs_cfapi" PROPERTIES set_target_properties(nextcloudsync_vfs_cfapi
LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} LIBRARY_OUTPUT_DIRECTORY
PREFIX "" ${BIN_OUTPUT_DIRECTORY}
AUTOMOC TRUE RUNTIME_OUTPUT_DIRECTORY
${BIN_OUTPUT_DIRECTORY}
PREFIX
""
AUTOMOC
TRUE
LIBRARY_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_cfapi
RUNTIME_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_cfapi
) )
target_include_directories("nextcloudsync_vfs_cfapi" BEFORE PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_BINARY_DIR}) target_include_directories("nextcloudsync_vfs_cfapi" BEFORE PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_BINARY_DIR})

View file

@ -1,18 +1,23 @@
add_library(nextcloudsync_vfs_suffix SHARED add_library(nextcloudsync_vfs_suffix SHARED
vfs_suffix.cpp vfs_suffix.cpp
) )
set_target_properties(nextcloudsync_vfs_suffix
PROPERTIES
LIBRARY_OUTPUT_NAME ${APPLICATION_EXECUTABLE}sync_vfs_suffix
)
target_link_libraries(nextcloudsync_vfs_suffix PRIVATE nextcloudsync) target_link_libraries(nextcloudsync_vfs_suffix PRIVATE nextcloudsync)
set_target_properties(nextcloudsync_vfs_suffix PROPERTIES set_target_properties(nextcloudsync_vfs_suffix
LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} LIBRARY_OUTPUT_DIRECTORY
PREFIX "" ${BIN_OUTPUT_DIRECTORY}
AUTOMOC TRUE RUNTIME_OUTPUT_DIRECTORY
${BIN_OUTPUT_DIRECTORY}
PREFIX
""
AUTOMOC
TRUE
LIBRARY_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_suffix
RUNTIME_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_suffix
) )
if(APPLE) if(APPLE)

View file

@ -7,18 +7,23 @@ if (LINUX)
add_library(nextcloudsync_vfs_xattr SHARED add_library(nextcloudsync_vfs_xattr SHARED
${vfs_xattr_SRCS} ${vfs_xattr_SRCS}
) )
set_target_properties(nextcloudsync_vfs_xattr
PROPERTIES
LIBRARY_OUTPUT_NAME ${APPLICATION_EXECUTABLE}sync_vfs_xattr
)
target_link_libraries(nextcloudsync_vfs_xattr PRIVATE nextcloudsync) target_link_libraries(nextcloudsync_vfs_xattr PRIVATE nextcloudsync)
set_target_properties(nextcloudsync_vfs_xattr PROPERTIES set_target_properties(nextcloudsync_vfs_xattr
LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} LIBRARY_OUTPUT_DIRECTORY
PREFIX "" ${BIN_OUTPUT_DIRECTORY}
AUTOMOC TRUE RUNTIME_OUTPUT_DIRECTORY
${BIN_OUTPUT_DIRECTORY}
PREFIX
""
AUTOMOC
TRUE
LIBRARY_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_xattr
RUNTIME_OUTPUT_NAME
${APPLICATION_EXECUTABLE}sync_vfs_xattr
) )
target_include_directories(nextcloudsync_vfs_xattr BEFORE PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(nextcloudsync_vfs_xattr BEFORE PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_CURRENT_BINARY_DIR})