summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt49
1 files changed, 27 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32aba0c..fc06bb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,10 +37,11 @@ string (REPLACE "-" "+" project_version_safe "${project_version}")
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake)
include (AddThreads)
-find_package (Curses)
find_package (PkgConfig REQUIRED)
-pkg_check_modules (dependencies REQUIRED libssl libcrypto libffi)
-pkg_check_modules (ncursesw ncursesw)
+pkg_check_modules (libssl REQUIRED libssl libcrypto)
+list (APPEND project_libraries ${libssl_LIBRARIES})
+include_directories (${libssl_INCLUDE_DIRS})
+link_directories (${libssl_LIBRARY_DIRS})
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
include_directories (/usr/local/include)
@@ -50,9 +51,20 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
-list (APPEND project_libraries ${dependencies_LIBRARIES})
-include_directories (${dependencies_INCLUDE_DIRS})
-link_directories (${dependencies_LIBRARY_DIRS})
+# -lrt is only for glibc < 2.17
+# -liconv may or may not be a part of libc
+foreach (extra iconv rt)
+ find_library (extra_lib_${extra} ${extra})
+ if (extra_lib_${extra})
+ list (APPEND project_libraries ${extra})
+ endif (extra_lib_${extra})
+endforeach (extra)
+
+# Dependencies for degesch
+pkg_check_modules (libffi REQUIRED libffi)
+list (APPEND degesch_libraries ${libffi_LIBRARIES})
+include_directories (${libffi_INCLUDE_DIRS})
+link_directories (${libffi_LIBRARY_DIRS})
# FIXME: other Lua versions may be acceptable, don't know yet
pkg_search_module (lua lua53 lua5.3 lua-5.3 lua>=5.3)
@@ -63,25 +75,18 @@ if (WITH_LUA)
message (FATAL_ERROR "Lua library not found")
endif (NOT lua_FOUND)
- list (APPEND project_libraries ${lua_LIBRARIES})
+ list (APPEND degesch_libraries ${lua_LIBRARIES})
include_directories (${lua_INCLUDE_DIRS})
link_directories (${lua_LIBRARY_DIRS})
endif (WITH_LUA)
-# -lrt is only for glibc < 2.17
-# -liconv may or may not be a part of libc
-foreach (extra iconv rt)
- find_library (extra_lib_${extra} ${extra})
- if (extra_lib_${extra})
- list (APPEND project_libraries ${extra})
- endif (extra_lib_${extra})
-endforeach (extra)
-
+find_package (Curses)
+pkg_check_modules (ncursesw ncursesw)
if (ncursesw_FOUND)
- list (APPEND project_libraries ${ncursesw_LIBRARIES})
+ list (APPEND degesch_libraries ${ncursesw_LIBRARIES})
include_directories (${ncursesw_INCLUDE_DIRS})
elseif (CURSES_FOUND)
- list (APPEND project_libraries ${CURSES_LIBRARY})
+ list (APPEND degesch_libraries ${CURSES_LIBRARY})
include_directories (${CURSES_INCLUDE_DIR})
else (CURSES_FOUND)
message (SEND_ERROR "Curses not found")
@@ -93,13 +98,13 @@ elseif (WANT_READLINE)
# OpenBSD's default readline is too old
if ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
include_directories (/usr/local/include/ereadline)
- list (APPEND project_libraries ereadline)
+ list (APPEND degesch_libraries ereadline)
else ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
- list (APPEND project_libraries readline)
+ list (APPEND degesch_libraries readline)
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
elseif (WANT_LIBEDIT)
pkg_check_modules (libedit REQUIRED libedit)
- list (APPEND project_libraries ${libedit_LIBRARIES})
+ list (APPEND degesch_libraries ${libedit_LIBRARIES})
include_directories (${libedit_INCLUDE_DIRS})
endif ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
@@ -133,7 +138,7 @@ add_threads (zyklonb)
add_executable (degesch degesch.c kike-replies.c
${common_sources} ${common_headers})
-target_link_libraries (degesch ${project_libraries})
+target_link_libraries (degesch ${project_libraries} ${degesch_libraries})
add_threads (degesch)
add_executable (kike kike.c kike-replies.c ${common_sources} ${common_headers})