Fix build under FreeBSD

This commit is contained in:
Přemysl Eric Janouch 2015-07-23 09:53:16 +02:00
parent 7be129b72c
commit 9a340e5b8f
1 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,14 @@ find_package (PkgConfig REQUIRED)
pkg_check_modules (libssl REQUIRED libssl libcrypto) pkg_check_modules (libssl REQUIRED libssl libcrypto)
pkg_check_modules (ncursesw ncursesw) pkg_check_modules (ncursesw ncursesw)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
# iconv() doesn't have to be present in libc
# FIXME: detect if we need the library independently on the platform
list (APPEND project_libraries iconv)
# Need this for SIGWINCH; our POSIX version macros make it undefined
add_definitions (-D__BSD_VISIBLE=1)
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
# -lpthread is only there for debugging (gdb & errno) # -lpthread is only there for debugging (gdb & errno)
# -lrt is only for glibc < 2.17 # -lrt is only for glibc < 2.17
list (APPEND project_libraries ${libssl_LIBRARIES} rt pthread) list (APPEND project_libraries ${libssl_LIBRARIES} rt pthread)