cmake: Make musl support more distro agnostic

This commit is contained in:
Andrew Benson 2020-06-16 17:59:44 -05:00
parent 86a75c8ac8
commit 7e5f9b857e

View file

@ -334,19 +334,12 @@ include_directories(BEFORE ${OPENSSL_INCLUDE_DIR})
# Make everyone find the highwayhash includes
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/highwayhash)
# Alpine support
if ( ${CMAKE_SYSTEM_NAME} MATCHES Linux AND EXISTS /etc/os-release )
execute_process(
COMMAND grep -q alpine /etc/os-release
RESULT_VARIABLE os_release_alpine
)
if ( os_release_alpine EQUAL 0 )
find_package(FTS REQUIRED)
# Determine if libfts is external to libc, i.e. musl
find_package(FTS)
if ( FTS_FOUND )
list(APPEND OPTLIBS ${FTS_LIBRARY})
include_directories(BEFORE ${FTS_INCLUDE_DIR})
endif ()
endif ()
set(zeekdeps ${zeekdeps}
${BinPAC_LIBRARY}