foreach(CLIENT IN LISTS CLIENTS)
add_executable(${CLIENT} ${CLIENT}.cc)
target_include_directories(${CLIENT} PRIVATE ..)
- target_link_libraries(${CLIENT} libclient_utilities)
+ target_link_libraries(${CLIENT} PRIVATE libclient_utilities)
+ set_target_properties(${CLIENT} PROPERTIES INSTALL_RPATH $ORIGIN/../${CMAKE_INSTALL_LIBDIR})
install(TARGETS ${CLIENT}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
# extra libs
-target_link_libraries(memcapable Threads::Threads)
-target_link_libraries(memping libmemcachedutil)
-target_link_libraries(memslap Threads::Threads)
+target_link_libraries(memcapable PRIVATE Threads::Threads)
+target_link_libraries(memping PRIVATE libmemcachedutil)
+target_link_libraries(memslap PRIVATE Threads::Threads)
# memaslap is special
add_executable(memaslap memaslap.c
ms_conn.c ms_setting.c ms_sigsegv.c ms_stats.c ms_task.c ms_thread.c)
target_include_directories(memaslap PRIVATE ${LIBEVENT_INCLUDEDIR})
- target_link_libraries(memaslap libclient_utilities ${LIBEVENT_LIBRARIES} Threads::Threads)
+ target_link_libraries(memaslap PRIVATE libclient_utilities ${LIBEVENT_LIBRARIES} Threads::Threads)
install(TARGETS memaslap
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
string.cc
)
add_library(hashkit ALIAS libhashkit)
-set_target_properties(libhashkit PROPERTIES LIBRARY_OUTPUT_NAME hashkit)
+set_target_properties(libhashkit PROPERTIES
+ LIBRARY_OUTPUT_NAME hashkit
+ INSTALL_RPATH $ORIGIN
+ SOVERSION ${LIBHASHKIT_SO_VERSION}
+ VERSION v${LIBHASHKIT_VERSION})
target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
target_include_directories(libhashkit PRIVATE
${CMAKE_SOURCE_DIR}/src
$<INSTALL_INTERFACE:include>)
configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
-set_target_properties(libhashkit PROPERTIES SOVERSION ${LIBHASHKIT_SO_VERSION})
install(TARGETS libhashkit EXPORT libhashkit
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
export(EXPORT libhashkit)
add_library(libmemcached SHARED
${LIBMEMCACHED_SOURCES})
add_library(memcached ALIAS libmemcached)
-set_target_properties(libmemcached PROPERTIES LIBRARY_OUTPUT_NAME memcached)
+set_target_properties(libmemcached PROPERTIES
+ LIBRARY_OUTPUT_NAME memcached
+ INSTALL_RPATH $ORIGIN
+ SOVERSION ${LIBMEMCACHED_SO_VERSION}
+ VERSION v${LIBMEMCACHED_VERSION})
target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED)
target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
target_include_directories(libmemcached PRIVATE ${LIBSASL_INCLUDEDIR})
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
-set_target_properties(libmemcached PROPERTIES SOVERSION ${LIBMEMCACHED_SO_VERSION})
install(TARGETS libmemcached EXPORT libmemcached
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
export(EXPORT libmemcached)
pedantic.c
)
add_library(memcachedprotocol ALIAS libmemcachedprotocol)
-set_target_properties(libmemcachedprotocol PROPERTIES LIBRARY_OUTPUT_NAME memcachedprotocol)
+set_target_properties(libmemcachedprotocol PROPERTIES
+ LIBRARY_OUTPUT_NAME memcachedprotocol
+ INSTALL_RPATH $ORIGIN
+ SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION}
+ VERSION v${LIBMEMCACHEDPROTOCOL_VERSION})
target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED)
target_link_libraries(libmemcachedprotocol PUBLIC libmemcached Threads::Threads)
target_include_directories(libmemcachedprotocol PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
-set_target_properties(libmemcachedprotocol PROPERTIES SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION})
install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
export(EXPORT libmemcachedprotocol)
version.cc
)
add_library(memcachedutil ALIAS libmemcachedutil)
-set_target_properties(libmemcachedutil PROPERTIES LIBRARY_OUTPUT_NAME memcachedutil)
+set_target_properties(libmemcachedutil PROPERTIES
+ LIBRARY_OUTPUT_NAME memcachedutil
+ INSTALL_RPATH $ORIGIN
+ SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION}
+ VERSION v${LIBMEMCACHEDUTIL_VERSION})
target_compile_definitions(libmemcachedutil PRIVATE -DBUILDING_LIBMEMCACHED)
target_link_libraries(libmemcachedutil PUBLIC libmemcached Threads::Threads)
target_include_directories(libmemcachedutil PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
-set_target_properties(libmemcachedutil PROPERTIES SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION})
install(TARGETS libmemcachedutil EXPORT libmemcachedutil
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
export(EXPORT libmemcachedutil)