aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cbc04c..1be90f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,14 @@ if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
set (CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -Wno-unused-function")
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
+if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
+ include_directories (/usr/local/include)
+ link_directories (/usr/local/lib)
+ # Need this for SIGWINCH in FreeBSD and OpenBSD respectively;
+ # our POSIX version macros make it undefined
+ add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
+endif ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
+
# Build options
option (USE_SYSTEM_TERMO "Don't compile our own termo, use the system one" OFF)
@@ -45,6 +53,14 @@ set (project_libraries ${LIBEV_LIBRARIES} ${Termo_LIBRARIES}
include_directories (${LIBEV_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS}
${NCURSESW_INCLUDE_DIRS})
+# -liconv may or may not be a part of libc
+foreach (extra iconv)
+ find_library (extra_lib_${extra} ${extra})
+ if (extra_lib_${extra})
+ list (APPEND project_libraries ${extra})
+ endif (extra_lib_${extra})
+endforeach (extra)
+
# Configuration
include (CheckFunctionExists)
set (CMAKE_REQUIRED_LIBRARIES ${project_libraries})