3 set(libmemcachedprotocol_sources
10 ../libmemcached/byteorder.cc
12 add_library(libmemcachedprotocol)
13 add_library(memcachedprotocol ALIAS libmemcachedprotocol)
14 set_target_properties(libmemcachedprotocol PROPERTIES
15 CXX_STANDARD ${CXX_STANDARD}
16 OUTPUT_NAME memcachedprotocol
17 OUTPUT_NAME_DEBUG memcachedprotocol-dbg
18 SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_SOVERSION}
19 VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION})
20 target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED)
21 if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
22 set_target_properties(libmemcachedprotocol PROPERTIES
23 LINK_FLAGS "-Wl,-undefined,dynamic_lookup"
26 target_link_libraries(libmemcachedprotocol PRIVATE p9y)
27 target_link_libraries(libmemcachedprotocol PUBLIC Threads::Threads)
29 target_link_libraries(libmemcachedprotocol PUBLIC wsock32 ws2_32)
31 target_include_directories(libmemcachedprotocol PRIVATE
32 ${CMAKE_SOURCE_DIR}/src
33 ${CMAKE_BINARY_DIR}/src
35 target_include_directories(libmemcachedprotocol PUBLIC
36 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
37 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
38 $<INSTALL_INTERFACE:include>)
40 install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol-targets
41 RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR}
42 ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
43 LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
44 ${TARGET_NAMELINK_COMPONENT}
46 export(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::)
47 install(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::
49 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
51 target_sources(libmemcachedprotocol PRIVATE
52 ${libmemcachedprotocol_sources}
53 ${libmemcachedprotocol_includes}