aboutsummaryrefslogtreecommitdiffstats
path: root/utils/CMakeLists.txt
blob: e0bb5c88636e789d94b87f5b93e42f7b971803db (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
SET(UTILSERVERSRC rspamd_http_server.c)
SET(UTILBENCHSRC rspamd_http_bench.c)
SET(RECVBENCHSRC received_parser_bench.c)

ADD_EXECUTABLE(rspamd-http-server ${UTILSERVERSRC})
SET_TARGET_PROPERTIES(rspamd-http-server PROPERTIES LINKER_LANGUAGE C)
TARGET_LINK_LIBRARIES(rspamd-http-server rspamd-server)
TARGET_LINK_LIBRARIES(rspamd-http-server rspamd-http-parser)
TARGET_LINK_LIBRARIES(rspamd-http-server ${RSPAMD_REQUIRED_LIBRARIES})

ADD_EXECUTABLE(rspamd-http-bench ${UTILBENCHSRC})
SET_TARGET_PROPERTIES(rspamd-http-bench PROPERTIES LINKER_LANGUAGE C)
TARGET_LINK_LIBRARIES(rspamd-http-bench rspamd-http-parser)
TARGET_LINK_LIBRARIES(rspamd-http-bench rspamd-server)
TARGET_LINK_LIBRARIES(rspamd-http-bench ${RSPAMD_REQUIRED_LIBRARIES})

ADD_EXECUTABLE(rspamd-received-bench ${RECVBENCHSRC})
SET_TARGET_PROPERTIES(rspamd-received-bench PROPERTIES LINKER_LANGUAGE C)
TARGET_LINK_LIBRARIES(rspamd-received-bench rspamd-server)
IF (ENABLE_SNOWBALL MATCHES "ON")
	TARGET_LINK_LIBRARIES(rspamd-received-bench stemmer)
ENDIF()
IF(ENABLE_HIREDIS MATCHES "ON")
	TARGET_LINK_LIBRARIES(rspamd-received-bench rspamd-hiredis)
ENDIF()
TARGET_LINK_LIBRARIES(rspamd-received-bench ${RSPAMD_REQUIRED_LIBRARIES})

IF (ENABLE_HYPERSCAN MATCHES "ON")
	SET_TARGET_PROPERTIES(rspamd-http-bench PROPERTIES LINKER_LANGUAGE CXX)
	SET_TARGET_PROPERTIES(rspamd-http-server PROPERTIES LINKER_LANGUAGE CXX)
	SET_TARGET_PROPERTIES(rspamd-received-bench PROPERTIES LINKER_LANGUAGE CXX)
ENDIF()

# Redirector
IF (ENABLE_REDIRECTOR MATCHES "ON")
    CONFIGURE_FILE(redirector.pl.in redirector.pl @ONLY)
    INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/redirector.pl"
            DESTINATION bin RENAME rspamd-redirector)
ENDIF (ENABLE_REDIRECTOR MATCHES "ON")