include(CMakeConfig.txt)
if(NOT BUILD_DOCSONLY)
- foreach(INCLUDE IN ITEMS ${CMAKE_BINARY_DIR} .)
- include_directories(
- ${INCLUDE}/
- ${INCLUDE}/include
- ${INCLUDE}/src
- )
- endforeach()
set(AUTOHEADER_FILE mem_config.h)
add_library(libclient_utilities STATIC utilities.cc generator.cc execute.cc)
add_library(client_utilities ALIAS libclient_utilities)
-target_link_libraries(libclient_utilities libmemcachedinternal)
+target_link_libraries(libclient_utilities PRIVATE libmemcachedinternal)
+target_include_directories(libclient_utilities PUBLIC
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_BINARY_DIR}/include
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+
foreach(CLIENT IN LISTS CLIENTS)
add_executable(${CLIENT} ${CLIENT}.cc)
add_library(hashkit ALIAS libhashkit)
set_target_properties(libhashkit PROPERTIES LIBRARY_OUTPUT_NAME hashkit)
target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
-
+target_include_directories(libhashkit PRIVATE
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+target_include_directories(libhashkit PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
set_target_properties(libhashkit PROPERTIES SOVERSION ${LIBHASHKIT_SO_VERSION})
${LIBMEMCACHED_SOURCES})
add_library(memcached ALIAS libmemcached)
set_target_properties(libmemcached PROPERTIES LIBRARY_OUTPUT_NAME memcached)
-target_link_libraries(libmemcached libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
-target_include_directories(libmemcached PRIVATE ${LIBSASL_INCLUDEDIR})
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})
+target_include_directories(libmemcached PRIVATE
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcached PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
set_target_properties(libmemcached PROPERTIES SOVERSION ${LIBMEMCACHED_SO_VERSION})
install(TARGETS libmemcached EXPORT libmemcached
${LIBMEMCACHED_SOURCES})
add_library(memcachedinternal ALIAS libmemcachedinternal)
set_target_properties(libmemcachedinternal PROPERTIES LIBRARY_OUTPUT_NAME memcachedinternal)
-target_link_libraries(libmemcachedinternal libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
-target_include_directories(libmemcachedinternal PRIVATE ${LIBSASL_INCLUDEDIR})
target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL)
+target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
+target_include_directories(libmemcachedinternal PRIVATE ${LIBSASL_INCLUDEDIR})
+target_include_directories(libmemcachedinternal PRIVATE
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcachedinternal PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
# let libmemcached depend on libmemcachedinternal to ensure that they do not
# compete for the same generated dependencies
add_library(memcachedprotocol ALIAS libmemcachedprotocol)
set_target_properties(libmemcachedprotocol PROPERTIES LIBRARY_OUTPUT_NAME memcachedprotocol)
target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED)
-target_link_libraries(libmemcachedprotocol libmemcached Threads::Threads)
+target_link_libraries(libmemcachedprotocol PUBLIC libmemcached Threads::Threads)
+target_include_directories(libmemcachedprotocol PRIVATE
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcachedprotocol PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
set_target_properties(libmemcachedprotocol PROPERTIES SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION})
install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol
add_library(memcachedutil ALIAS libmemcachedutil)
set_target_properties(libmemcachedutil PROPERTIES LIBRARY_OUTPUT_NAME memcachedutil)
target_compile_definitions(libmemcachedutil PRIVATE -DBUILDING_LIBMEMCACHED)
-target_link_libraries(libmemcachedutil libmemcached Threads::Threads)
+target_link_libraries(libmemcachedutil PUBLIC libmemcached Threads::Threads)
+target_include_directories(libmemcachedutil PRIVATE
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_BINARY_DIR})
+target_include_directories(libmemcachedutil PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
set_target_properties(libmemcachedutil PROPERTIES SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION})
install(TARGETS libmemcachedutil EXPORT libmemcachedutil