summaryrefslogtreecommitdiffstats
path: root/plugin/CMakeLists.txt
blob: 60d221f1a22ca940cf0bbbaf536423cb984c5bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROJECT(eurephia-auth C)
cmake_minimum_required(VERSION 2.6)
SET(eurephia_auth_SRC
	../common/certinfo.c
	eurephia-auth.c
	eurephia.c
	../database/eurephiadb.c
	eurephiadb_session.c
	firewall/eurephiafw.c
	firewall/eurephiafw_helpers.c
	../common/eurephia_getsym.c
	../common/eurephia_log.c
	../common/eurephia_values.c
	../common/passwd.c
	../common/sha512.c
)
SET(subdirs "")
IF(FW_IPTABLES)
        message(STATUS "Will build iptables firewall module")
       SET(subdirs firewall/iptables)
ENDIF(FW_IPTABLES)

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)
CHECK_LIBRARY_EXISTS(rt mq_open "" HAVE_RT_MQ_OPEN)
CHECK_LIBRARY_EXISTS(rt mq_close "" HAVE_RT_MQ_CLOSE)
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)
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)
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)

INCLUDE_DIRECTORIES(../common ../database ./firewall .)
ADD_LIBRARY(eurephia-auth MODULE ${eurephia_auth_SRC})
TARGET_LINK_LIBRARIES(eurephia-auth dl pthread rt crypto)
SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES OUTPUT_NAME eurephia-auth PREFIX "")

INSTALL(TARGETS eurephia-auth  LIBRARY DESTINATION ${PREFIX})

IF(subdirs)
        SUBDIRS(${subdirs})
ENDIF(subdirs)