Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,28 @@ endif()
if(WIN32)
set(with_sasl_default ON)
else()
if(PkgConfig_FOUND)
pkg_check_modules(SASL libsasl2)
if(SASL_FOUND)
set(with_sasl_default ON)
else()
try_compile(
WITH_SASL_CYRUS_BOOL
"${CMAKE_CURRENT_BINARY_DIR}/try_compile"
"${TRYCOMPILE_SRC_DIR}/libsasl2_test.c"
LINK_LIBRARIES "-lsasl2"
)
if(WITH_SASL_CYRUS_BOOL)
find_package(SASL2 QUIET)
if (SASL2_FOUND)
set(with_sasl_default ON)
else
if(PkgConfig_FOUND)
pkg_check_modules(SASL libsasl2)
if(SASL_FOUND)
set(with_sasl_default ON)
set(SASL_LIBRARIES "-lsasl2")
else()
set(with_sasl_default OFF)
endif()
else()
try_compile(
WITH_SASL_CYRUS_BOOL
"${CMAKE_CURRENT_BINARY_DIR}/try_compile"
"${TRYCOMPILE_SRC_DIR}/libsasl2_test.c"
LINK_LIBRARIES "-lsasl2"
)
if(WITH_SASL_CYRUS_BOOL)
set(with_sasl_default ON)
set(SASL_LIBRARIES "-lsasl2")
else()
set(with_sasl_default OFF)
Comment on lines +131 to +146
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether we still need this if we are using find_package(SASL2).

endif()
endif()
endif()
endif()
endif()
Expand Down