From: Michael Wallner Date: Fri, 30 Oct 2020 16:07:52 +0000 (+0100) Subject: cmake: fix libsasl linking X-Git-Tag: 1.1.0-beta1~142 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=0e1198064e6f95724d7bc92cc9ef14eb8a37e245;p=awesomized%2Flibmemcached cmake: fix libsasl linking --- diff --git a/src/libmemcached/CMakeLists.txt b/src/libmemcached/CMakeLists.txt index d51295d5..6ed96a88 100644 --- a/src/libmemcached/CMakeLists.txt +++ b/src/libmemcached/CMakeLists.txt @@ -91,11 +91,13 @@ set_target_properties(libmemcached PROPERTIES VERSION v${LIBMEMCACHED_VERSION}) target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED) target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS} ${Backtrace_LIBRARIES}) -if(PKG_CONFIG_FOUND) - target_link_libraries(libmemcached PUBLIC libhashkit PkgConfig::LIBSASL) -else() - target_link_libraries(libmemcached PUBLIC ${LIBSASL_LIBRARIES}) - target_include_directories(libmemcached PUBLIC ${LIBSASL_INCLUDEDIR}) +if(LIBSASL_FOUND) + if(PKG_CONFIG_FOUND) + target_link_libraries(libmemcached PUBLIC PkgConfig::LIBSASL) + else() + target_link_libraries(libmemcached PUBLIC ${LIBSASL_LIBRARIES}) + target_include_directories(libmemcached PUBLIC ${LIBSASL_INCLUDEDIR}) + endif() endif() target_include_directories(libmemcached PRIVATE ${Backtrace_INCLUDE_DIR}) target_include_directories(libmemcached PRIVATE