if(FOUND)
message("-- Found library '${LIB${LIB}}'")
message("-- Found include '${${HEADER_CONST}_ROOT}'")
+ set(${NAME} ${NAME} PARENT_SCOPE)
add_library(${NAME} INTERFACE IMPORTED)
set_target_properties(${NAME} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${${HEADER_CONST}_ROOT}
pkg_check_modules(${NAME} ${LIB}${ARGN})
endif()
if(${NAME}_FOUND)
- add_library(${NAME} ALIAS PkgConfig::${NAME})
+ set(${NAME} PkgConfig::${NAME} PARENT_SCOPE)
endif()
endif()
if(NOT ${NAME}_FOUND)
check_dependency(LIBTBB tbb tbb/task.h)
if(HAVE_LIBTBB)
cmake_push_check_state(RESET)
- get_property(LIBTBB_INCLUDEDIR TARGET LIBTBB PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
- get_property(LIBTBB_LIBRARIES TARGET LIBTBB PROPERTY INTERFACE_LINK_LIBRARIES)
+ get_property(LIBTBB_INCLUDEDIR TARGET ${LIBTBB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ get_property(LIBTBB_LIBRARIES TARGET ${LIBTBB} PROPERTY INTERFACE_LINK_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES "${LIBTBB_INCLUDEDIR}")
set(CMAKE_REQUIRED_LIBRARIES "${LIBTBB_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS -std=c++17)
find_package(Backtrace)
if(Backtrace_FOUND)
set(HAVE_BACKTRACE 1)
+ set(BACKTRACE BACKTRACE)
add_library(BACKTRACE INTERFACE IMPORTED)
set_target_properties(BACKTRACE PROPERTIES
INTERFACE_LINK_LIBRARIES "${Backtrace_LIBRARIES}"
memaslap/ms_task.c
memaslap/ms_thread.c)
target_include_directories(memaslap PRIVATE memaslap)
- target_link_libraries(memaslap PRIVATE libclient_common Threads::Threads LIBEVENT)
+ target_link_libraries(memaslap PRIVATE libclient_common Threads::Threads ${LIBEVENT})
if(CMAKE_INSTALL_RPATH)
set_target_properties(${CLIENT} PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_RPATH}/../${CMAKE_INSTALL_LIBDIR})
target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED)
target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS})
if(HAVE_BACKTRACE)
- target_link_libraries(libmemcached PRIVATE BACKTRACE)
+ target_link_libraries(libmemcached PRIVATE ${BACKTRACE})
endif()
if(HAVE_LIBSASL)
- target_link_libraries(libmemcached PUBLIC LIBSASL)
+ target_link_libraries(libmemcached PUBLIC ${LIBSASL})
endif()
target_include_directories(libmemcached PRIVATE
${CMAKE_SOURCE_DIR}/src
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} ${Backtrace_LIBRARIES})
+target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS})
if(HAVE_LIBSASL)
- target_link_libraries(libmemcachedinternal PUBLIC LIBSASL)
+ target_link_libraries(libmemcachedinternal PUBLIC ${LIBSASL})
+endif()
+if(HAVE_BACKTRACE)
+ target_link_libraries(libmemcachedinternal PRIVATE ${BACKTRACE})
endif()
-target_include_directories(libmemcachedinternal PRIVATE ${Backtrace_INCLUDE_DIR})
target_include_directories(libmemcachedinternal PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
endif()
target_link_libraries(libmemcachedutil PUBLIC Threads::Threads)
if(HAVE_LIBSASL)
- target_link_libraries(libmemcachedutil PUBLIC LIBSASL)
+ target_link_libraries(libmemcachedutil PUBLIC ${LIBSASL})
endif()
target_include_directories(libmemcachedutil PRIVATE
${CMAKE_SOURCE_DIR}/src
check_tbb()
if(HAVE_TBB)
message("HAVE TBB")
- target_link_libraries(runtests PRIVATE LIBTBB)
+ target_link_libraries(runtests PRIVATE ${LIBTBB})
endif()
add_dependencies(runtests ${CLIENTS})