Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: fix rpath on shared libraries and binaries targets #12927

Merged
merged 1 commit into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ add_library(ceph-common SHARED
$<TARGET_OBJECTS:common-objs>
$<TARGET_OBJECTS:common_mountcephfs_objs>
$<TARGET_OBJECTS:global_common_objs>)
set_target_properties(ceph-common PROPERTIES
INSTALL_RPATH "")
target_link_libraries(ceph-common json_spirit erasure_code rt ${LIB_RESOLV}
${Boost_THREAD_LIBRARY}
${Boost_SYSTEM_LIBRARY}
Expand Down Expand Up @@ -891,6 +893,8 @@ if(WITH_LIBCEPHFS)
add_executable(mount.ceph ${mount_ceph_srcs}
$<TARGET_OBJECTS:parse_secret_objs>
$<TARGET_OBJECTS:common_mountcephfs_objs>)
set_target_properties(mount.ceph PROPERTIES
INSTALL_RPATH "")
target_link_libraries(mount.ceph ${KEYUTILS_LIBRARIES})

install(TARGETS ceph-syn DESTINATION bin)
Expand Down
75 changes: 60 additions & 15 deletions src/cls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ set(cls_embedded_srcs)
# cls_hello
set(cls_hello_srcs hello/cls_hello.cc)
add_library(cls_hello SHARED ${cls_hello_srcs})
set_target_properties(cls_hello PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_hello PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_hello DESTINATION ${cls_dir})
list(APPEND cls_embedded_srcs ${cls_hello_srcs})

# cls_numops
set(cls_numops_srcs numops/cls_numops.cc)
add_library(cls_numops SHARED ${cls_numops_srcs})
set_target_properties(cls_numops PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_numops PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_numops DESTINATION ${cls_dir})

set(cls_numops_client_srcs numops/cls_numops_client.cc)
Expand All @@ -25,7 +31,10 @@ list(APPEND cls_embedded_srcs ${cls_numops_srcs} ${cls_numops_client_srcs})
if (WITH_RBD)
set(cls_rbd_srcs rbd/cls_rbd.cc rbd/cls_rbd_types.cc)
add_library(cls_rbd SHARED ${cls_rbd_srcs})
set_target_properties(cls_rbd PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_rbd PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_rbd DESTINATION ${cls_dir})

set(cls_rbd_client_srcs rbd/cls_rbd_client.cc rbd/cls_rbd_types.cc)
Expand All @@ -38,7 +47,10 @@ endif (WITH_RBD)
# cls_lock
set(cls_lock_srcs lock/cls_lock.cc)
add_library(cls_lock SHARED ${cls_lock_srcs})
set_target_properties(cls_lock PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_lock PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_lock DESTINATION ${cls_dir})

set(cls_lock_client_srcs
Expand All @@ -56,7 +68,10 @@ set(cls_refcount_srcs
${CMAKE_SOURCE_DIR}/src/common/ceph_json.cc)
add_library(cls_refcount SHARED ${cls_refcount_srcs})
target_link_libraries(cls_refcount json_spirit)
set_target_properties(cls_refcount PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_refcount PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_refcount DESTINATION ${cls_dir})

set(cls_refcount_client_srcs
Expand All @@ -69,7 +84,10 @@ list(APPEND cls_embedded_srcs ${cls_refcount_srcs} ${cls_refcount_client_srcs})
# cls_version
set(cls_version_srcs version/cls_version.cc)
add_library(cls_version SHARED ${cls_version_srcs})
set_target_properties(cls_version PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_version PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_version DESTINATION ${cls_dir})

set(cls_version_client_srcs
Expand All @@ -82,7 +100,10 @@ list(APPEND cls_embedded_srcs ${cls_version_srcs} ${cls_version_client_srcs})
# cls_log
set(cls_log_srcs log/cls_log.cc)
add_library(cls_log SHARED ${cls_log_srcs})
set_target_properties(cls_log PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_log PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_log DESTINATION ${cls_dir})

set(cls_log_client_srcs log/cls_log_client.cc)
Expand All @@ -93,7 +114,10 @@ list(APPEND cls_embedded_srcs ${cls_log_srcs} ${cls_log_client_srcs})
# cls_statelog
set(cls_statelog_srcs statelog/cls_statelog.cc)
add_library(cls_statelog SHARED ${cls_statelog_srcs})
set_target_properties(cls_statelog PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_statelog PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_statelog DESTINATION ${cls_dir})

set(cls_statelog_client_srcs statelog/cls_statelog_client.cc)
Expand All @@ -104,7 +128,10 @@ list(APPEND cls_embedded_srcs ${cls_statelog_srcs} ${cls_statelog_client_srcs})
# cls_timeindex
set(cls_timeindex_srcs timeindex/cls_timeindex.cc)
add_library(cls_timeindex SHARED ${cls_timeindex_srcs})
set_target_properties(cls_timeindex PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_timeindex PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_timeindex DESTINATION ${cls_dir})

set(cls_timeindex_client_srcs timeindex/cls_timeindex_client.cc)
Expand All @@ -115,7 +142,10 @@ list(APPEND cls_embedded_srcs ${cls_timeindex_srcs} ${cls_timeindex_client_srcs}
# cls_replica_log
set(cls_replica_log_srcs replica_log/cls_replica_log.cc)
add_library(cls_replica_log SHARED ${cls_replica_log_srcs})
set_target_properties(cls_replica_log PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_replica_log PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_replica_log DESTINATION ${cls_dir})

set(cls_replica_log_client_srcs
Expand All @@ -129,7 +159,10 @@ list(APPEND cls_embedded_srcs ${cls_replica_log_srcs} ${cls_replica_log_client_s
# cls_user
set(cls_user_srcs user/cls_user.cc)
add_library(cls_user SHARED ${cls_user_srcs})
set_target_properties(cls_user PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_user PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_user DESTINATION ${cls_dir})

set(cls_user_client_srcs
Expand All @@ -145,7 +178,10 @@ set(cls_journal_srcs
journal/cls_journal.cc
journal/cls_journal_types.cc)
add_library(cls_journal SHARED ${cls_journal_srcs})
set_target_properties(cls_journal PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_journal PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_journal DESTINATION ${cls_dir})

set(cls_journal_client_srcs
Expand All @@ -164,7 +200,10 @@ if (WITH_RADOSGW)
${CMAKE_SOURCE_DIR}/src/common/ceph_json.cc)
add_library(cls_rgw SHARED ${cls_rgw_srcs})
target_link_libraries(cls_rgw json_spirit)
set_target_properties(cls_rgw PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_rgw PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_rgw DESTINATION ${cls_dir})

set(cls_rgw_client_srcs
Expand All @@ -181,7 +220,10 @@ if (WITH_CEPHFS)
set(cls_cephfs_srcs
cephfs/cls_cephfs.cc)
add_library(cls_cephfs SHARED ${cls_cephfs_srcs})
set_target_properties(cls_cephfs PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_cephfs PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_cephfs DESTINATION ${cls_dir})

set(cls_cephfs_client_srcs
Expand All @@ -196,7 +238,10 @@ set(cls_lua_srcs
lua/cls_lua.cc
lua/lua_bufferlist.cc)
add_library(cls_lua SHARED ${cls_lua_srcs})
set_target_properties(cls_lua PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_lua PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_lua DESTINATION ${cls_dir})
target_link_libraries(cls_lua
liblua
Expand Down
5 changes: 4 additions & 1 deletion src/compressor/snappy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ set(snappy_sources
add_library(ceph_snappy SHARED ${snappy_sources})
add_dependencies(ceph_snappy ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
target_link_libraries(ceph_snappy ${SNAPPY_LIBRARIES})
set_target_properties(ceph_snappy PROPERTIES VERSION 2.0.0 SOVERSION 2)
set_target_properties(ceph_snappy PROPERTIES
VERSION 2.0.0
SOVERSION 2
INSTALL_RPATH "")
install(TARGETS ceph_snappy DESTINATION ${compressor_plugin_dir})

if(WITH_EMBEDDED)
Expand Down
5 changes: 4 additions & 1 deletion src/compressor/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ add_library(ceph_zlib SHARED ${zlib_sources})
add_dependencies(ceph_zlib ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
target_link_libraries(ceph_zlib ${ZLIB_LIBRARIES})
target_include_directories(ceph_zlib PRIVATE "${CMAKE_SOURCE_DIR}/src/isa-l/include")
set_target_properties(ceph_zlib PROPERTIES VERSION 2.0.0 SOVERSION 2)
set_target_properties(ceph_zlib PROPERTIES
VERSION 2.0.0
SOVERSION 2
INSTALL_RPATH "")
install(TARGETS ceph_zlib DESTINATION ${compressor_plugin_dir})

if(WITH_EMBEDDED)
Expand Down
5 changes: 4 additions & 1 deletion src/erasure-code/isa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ add_library(ec_isa SHARED
$<TARGET_OBJECTS:erasure_code_objs>)
add_dependencies(ec_isa ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
target_link_libraries(ec_isa ${EXTRALIBS})
set_target_properties(ec_isa PROPERTIES VERSION 2.14.0 SOVERSION 2)
set_target_properties(ec_isa PROPERTIES
VERSION 2.14.0
SOVERSION 2
INSTALL_RPATH "")
install(TARGETS ec_isa DESTINATION ${erasure_plugin_dir})

if(WITH_EMBEDDED)
Expand Down
4 changes: 4 additions & 0 deletions src/erasure-code/jerasure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ set(ec_jerasure_objs
$<TARGET_OBJECTS:erasure_code_objs>)

add_library(ec_jerasure SHARED ${ec_jerasure_objs})
set_target_properties(ec_jerasure PROPERTIES
INSTALL_RPATH "")
target_link_libraries(ec_jerasure ${EXTRALIBS})
install(TARGETS ec_jerasure DESTINATION ${erasure_plugin_dir})

# legacy libraries
foreach(flavor ${jerasure_legacy_flavors})
set(plugin_name "ec_jerasure_${flavor}")
add_library(${plugin_name} SHARED ${ec_jerasure_objs})
set_target_properties(${plugin_name} PROPERTIES
INSTALL_RPATH "")
install(TARGETS ${plugin_name} DESTINATION ${erasure_plugin_dir})
add_dependencies(ec_jerasure ${plugin_name})
endforeach()
Expand Down
2 changes: 2 additions & 0 deletions src/erasure-code/lrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set(lrc_srcs

add_library(ec_lrc SHARED ${lrc_srcs})
add_dependencies(ec_lrc ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
set_target_properties(ec_lrc PROPERTIES
INSTALL_RPATH "")
target_link_libraries(ec_lrc crush json_spirit)
install(TARGETS ec_lrc DESTINATION ${erasure_plugin_dir})

Expand Down
4 changes: 4 additions & 0 deletions src/erasure-code/shec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ set(ec_shec_objs

add_library(ec_shec SHARED ${ec_shec_objs})
add_dependencies(ec_shec ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
set_target_properties(ec_shec PROPERTIES
INSTALL_RPATH "")
target_link_libraries(ec_shec ${EXTRALIBS})
install(TARGETS ec_shec DESTINATION ${erasure_plugin_dir})

# legacy libraries
foreach(flavor ${jerasure_legacy_flavors})
set(plugin_name "ec_shec_${flavor}")
add_library(${plugin_name} SHARED ${ec_shec_objs})
set_target_properties(${plugin_name} PROPERTIES
INSTALL_RPATH "")
install(TARGETS ${plugin_name} DESTINATION ${erasure_plugin_dir})
add_dependencies(ec_shec ${plugin_name})
endforeach()
Expand Down
5 changes: 4 additions & 1 deletion src/key_value_store/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set(kvs_srcs cls_kvs.cc)
add_library(cls_kvs SHARED ${kvs_srcs})
set_target_properties(cls_kvs PROPERTIES VERSION "1.0.0" SOVERSION "1")
set_target_properties(cls_kvs PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_kvs DESTINATION ${CMAKE_INSTALL_LIBDIR}/rados-classes)

if(WITH_EMBEDDED)
Expand Down
3 changes: 2 additions & 1 deletion src/tracing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function(add_tracing_library name tracings version)
set_target_properties(${name} PROPERTIES
OUTPUT_NAME ${name}
VERSION ${version}
SOVERSION ${soversion})
SOVERSION ${soversion}
INSTALL_RPATH "")
endfunction()

set(osd_traces oprequest.tp osd.tp pg.tp)
Expand Down