summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 11:57:05 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 11:57:05 +0200
commit05418bf005850846b69c0c055b7f81d25add3732 (patch)
tree5fce35969491779fbee4b3d9cbeca08d081a1f89
parent54dd23b29971cbcf5c78d2df93da02f4a501345d (diff)
downloadeurephia-05418bf005850846b69c0c055b7f81d25add3732.tar.gz
eurephia-05418bf005850846b69c0c055b7f81d25add3732.tar.xz
eurephia-05418bf005850846b69c0c055b7f81d25add3732.zip
Cleaned up the CMake rules for the eurephia-auth.so plug-in
-rw-r--r--plugin/CMakeLists.txt57
1 files changed, 38 insertions, 19 deletions
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt
index 21ab780..ba5bff2 100644
--- a/plugin/CMakeLists.txt
+++ b/plugin/CMakeLists.txt
@@ -1,23 +1,7 @@
PROJECT(eurephia-plugin C)
cmake_minimum_required(VERSION 2.6)
-SET(eurephia_auth_SRC
- eurephia-auth.c
- eurephia.c
- eurephiadb_session.c
- firewall/eurephiafw.c
- firewall/eurephiafw_helpers.c
- ../common/eurephiadb_session_common.c
-)
-SET(subdirs "")
-IF(FW_IPTABLES)
- message(STATUS "Will build iptables firewall module")
- SET(subdirs firewall/iptables)
-ENDIF(FW_IPTABLES)
-
-IF(ENABLE_EUREPHIADM)
- REMOVE_DEFINITIONS(-DENABLE_EUREPHIADM)
-ENDIF(ENABLE_EUREPHIADM)
+# Check for librt functions which we use
CHECK_LIBRARY_EXISTS(rt sem_wait "" HAVE_RT_SEM_WAIT)
CHECK_LIBRARY_EXISTS(rt sem_timedwait "" HAVE_RT_SEM_TIMEDWAIT)
CHECK_LIBRARY_EXISTS(rt sem_post "" HAVE_RT_SEM_POST)
@@ -27,20 +11,55 @@ CHECK_LIBRARY_EXISTS(rt mq_unlink "" HAVE_RT_MQ_UNLINK)
CHECK_LIBRARY_EXISTS(rt mq_send "" HAVE_RT_MQ_SEND)
CHECK_LIBRARY_EXISTS(rt mq_receive "" HAVE_RT_MQ_RECEIVE)
CHECK_LIBRARY_EXISTS(rt mq_getattr "" HAVE_RT_MQ_GETATTR)
+
+# Fail if we're missing some features - semaphore functions
IF(NOT HAVE_RT_SEM_WAIT OR NOT HAVE_RT_SEM_TIMEDWAIT OR NOT HAVE_RT_SEM_POST)
message(FATAL_ERROR "Missing proper pthread semaphore support")
ENDIF(NOT HAVE_RT_SEM_WAIT OR NOT HAVE_RT_SEM_TIMEDWAIT OR NOT HAVE_RT_SEM_POST)
+
+# Fail if we're missing some features - Posix Message Queue functions
IF(NOT HAVE_RT_MQ_OPEN OR NOT HAVE_RT_MQ_CLOSE OR NOT HAVE_RT_MQ_UNLINK OR NOT HAVE_RT_MQ_SEND OR NOT HAVE_RT_MQ_RECEIVE OR NOT HAVE_RT_MQ_GETATTR)
message(FATAL_ERROR "Missing proper pthread message queue support")
ENDIF(NOT HAVE_RT_MQ_OPEN OR NOT HAVE_RT_MQ_CLOSE OR NOT HAVE_RT_MQ_UNLINK OR NOT HAVE_RT_MQ_SEND OR NOT HAVE_RT_MQ_RECEIVE OR NOT HAVE_RT_MQ_GETATTR)
+
+# Compiler settings
INCLUDE_DIRECTORIES(../common ../database ./firewall .)
-ADD_LIBRARY(eurephia-auth MODULE ${eurephia_auth_SRC})
+
+
+# Do build in subdirs, if some extra modules are enabled
+SET(subdirs "")
+IF(FW_IPTABLES)
+ # iptables module support
+ message(STATUS "Will build iptables firewall module")
+ SET(subdirs firewall/iptables)
+ENDIF(FW_IPTABLES)
+
+
+# Avoid adding administration features into the openvpn plug-in
+IF(ENABLE_EUREPHIADM)
+ REMOVE_DEFINITIONS(-DENABLE_EUREPHIADM)
+ENDIF(ENABLE_EUREPHIADM)
+
+
+# Build rule for eurephia-auth.so
+ADD_LIBRARY(eurephia-auth MODULE
+ eurephia-auth.c
+ eurephia.c
+ eurephiadb_session.c
+ firewall/eurephiafw.c
+ firewall/eurephiafw_helpers.c
+ ../common/eurephiadb_session_common.c
+)
+SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES PREFIX "")
+
+# Link in libraries
TARGET_LINK_LIBRARIES(eurephia-auth dl pthread rt crypto common)
-SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES OUTPUT_NAME eurephia-auth PREFIX "")
+# Install rules
INSTALL(TARGETS eurephia-auth LIBRARY DESTINATION ${PLUGINDIR})
+# If subdirs contains more directories with build/install rules, do that
IF(subdirs)
ADD_SUBDIRECTORY(${subdirs})
ENDIF(subdirs)