X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibmemcached%2FCMakeLists.txt;h=51d2dd1884392445d7b45334e69a07dab3910ab0;hb=118abd2f53e24a4f312ad0fcd484f6f8dbe5094c;hp=35e5b0f0dc9ac91491cc8d8bacce1ddf911d3f12;hpb=01c5e0ed8d3d9c72ea192792d1c49a50e756d635;p=m6w6%2Flibmemcached diff --git a/src/libmemcached/CMakeLists.txt b/src/libmemcached/CMakeLists.txt index 35e5b0f0..51d2dd18 100644 --- a/src/libmemcached/CMakeLists.txt +++ b/src/libmemcached/CMakeLists.txt @@ -12,8 +12,12 @@ bison_target(CSL_PARSER csl/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.cc COMPILE_FLAGS ${BISON_WARNINGS} ) set_source_files_properties(${BISON_CSL_PARSER_OUTPUTS} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +if(NOT HAVE_UNISTD_H) + set(FLEX_FLAGS --nounistd) +endif() flex_target(CSL_SCANNER csl/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.cc DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.h + COMPILE_FLAGS "${FLEX_FLAGS}" ) set_source_files_properties(${FLEX_CSL_SCANNER_OUTPUTS} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) add_flex_bison_dependency(CSL_SCANNER CSL_PARSER) @@ -53,7 +57,6 @@ set(LIBMEMCACHED_SOURCES namespace.cc options.cc parse.cc - poll.cc purge.cc quit.cc response.cc @@ -91,6 +94,10 @@ set_target_properties(libmemcached PROPERTIES SOVERSION ${LIBMEMCACHED_SO_VERSION}) target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED) target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS}) +target_link_libraries(libmemcached PRIVATE p9y) +if(MSVC) + target_link_libraries(libmemcached PUBLIC wsock32 ws2_32) +endif() if(HAVE_BACKTRACE) target_link_libraries(libmemcached PUBLIC ${BACKTRACE}) endif() @@ -113,9 +120,15 @@ target_include_directories(libmemcached PUBLIC enable_dtrace_for(libmemcached libmemcached_probes.d dtrace_probes.h) install(TARGETS libmemcached EXPORT libmemcached-targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR} + ${TARGET_NAMELINK_COMPONENT} + ) export(EXPORT libmemcached-targets NAMESPACE libmemcached::) -install(EXPORT libmemcached-targets NAMESPACE libmemcached:: DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) +install(EXPORT libmemcached-targets NAMESPACE libmemcached:: + COMPONENT dev + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) install_public_headers( libmemcached @@ -131,6 +144,10 @@ add_library(memcachedinternal ALIAS libmemcachedinternal) set_target_properties(libmemcachedinternal PROPERTIES CXX_STANDARD ${CXX_STANDARD} LIBRARY_OUTPUT_NAME memcachedinternal) target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL) target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS}) +target_link_libraries(libmemcachedinternal PRIVATE p9y) +if(MSVC OR MINGW) + target_link_libraries(libmemcached PUBLIC wsock32 ws2_32) +endif() if(HAVE_LIBSASL) target_link_libraries(libmemcachedinternal PUBLIC ${LIBSASL}) endif()