3 add_library(libmemcachedprotocol SHARED
10 ../libmemcached/byteorder.cc
12 add_library(memcachedprotocol ALIAS libmemcachedprotocol)
13 set_target_properties(libmemcachedprotocol PROPERTIES
14 CXX_STANDARD ${CXX_STANDARD}
15 LIBRARY_OUTPUT_NAME memcachedprotocol
16 LIBRARY_OUTPUT_NAME_DEBUG memcachedprotocol-dbg
17 SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION})
18 target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED)
19 if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
20 set_target_properties(libmemcachedprotocol PROPERTIES
21 LINK_FLAGS "-Wl,-undefined,dynamic_lookup"
24 target_link_libraries(libmemcachedprotocol PRIVATE p9y)
25 target_link_libraries(libmemcachedprotocol PUBLIC Threads::Threads)
27 target_link_libraries(libmemcachedprotocol PUBLIC wsock32 ws2_32)
29 target_include_directories(libmemcachedprotocol PRIVATE
30 ${CMAKE_SOURCE_DIR}/src
31 ${CMAKE_BINARY_DIR}/src
33 target_include_directories(libmemcachedprotocol PUBLIC
34 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
35 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
36 $<INSTALL_INTERFACE:include>)
38 install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol-targets
39 RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR}
40 ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
41 LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
42 ${TARGET_NAMELINK_COMPONENT}
44 export(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::)
45 install(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::
47 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake)