blob: 2b6ec2e4bd3dc003ca32d5e002a64524ea4c2f30 [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# The rt_ereg extension
2PROJECT("Regular expression matching based routing extension" C)
3
4# Check if REG_STARTEND is provided on the host
5SET(CHECK_REG_STARTEND_SOURCE_CODE "
6 #include <unistd.h>
7 #include <regex.h>
8 int main() {
9 return regexec(NULL, NULL, 0, NULL, REG_STARTEND);
10 }
11 ")
12CHECK_C_SOURCE_COMPILES("${CHECK_REG_STARTEND_SOURCE_CODE}" HAVE_REG_STARTEND)
13IF (HAVE_REG_STARTEND)
14 ADD_DEFINITIONS(-DHAVE_REG_STARTEND)
15ENDIF (HAVE_REG_STARTEND)
16
17
18# Parser files
19BISON_FILE(rtereg_conf.y)
20FLEX_FILE(rtereg_conf.l)
21SET_SOURCE_FILES_PROPERTIES(lex.rtereg_conf.c rtereg_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}")
22
23# List of source files
24SET( RTEREG_SRC
25 rtereg.c
26 rtereg.h
27 lex.rtereg_conf.c
28 rtereg_conf.tab.c
29 rtereg_conf.tab.h
30)
31
32INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
33
34# Compile these files as a freeDiameter extension
35FD_ADD_EXTENSION(rt_ereg ${RTEREG_SRC})
36
37
38####
39## INSTALL section ##
40
41# We install with the daemon component because it is a base feature.
42INSTALL(TARGETS rt_ereg
43 LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX}
44 COMPONENT freeDiameter-daemon)