blob: 507e96ae663a081a61e32ac40b44723d0d519fea [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# The test_netemul extension
2PROJECT("Simple Diameter network emulator proxy extension (latency, PDV, duplicates)" C)
3
4# Parser files
5BISON_FILE(test_netemul.y)
6FLEX_FILE(test_netemul.l)
7SET_SOURCE_FILES_PROPERTIES(lex.test_netemul.c test_netemul.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}")
8
9# List of source files
10SET( TNEMUL_SRC
11 test_netemul.c
12 test_netemul.h
13 lex.test_netemul.c
14 test_netemul.tab.c
15 test_netemul.tab.h
16 tne_process.c
17)
18
19INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
20
21# Compile these files as a freeDiameter extension
22FD_ADD_EXTENSION(test_netemul ${TNEMUL_SRC})
23
24
25# math functions
26CHECK_FUNCTION_EXISTS (sqrt HAVE_SQRT)
27IF (HAVE_SQRT)
28 SET(MATH_LIBS "")
29ELSE (HAVE_SQRT)
30 CHECK_LIBRARY_EXISTS (m sqrt "" HAVE_LIBM)
31 IF (HAVE_LIBM)
32 SET(MATH_LIBS "-lm")
33 ENDIF (HAVE_LIBM)
34ENDIF (HAVE_SQRT)
35
36TARGET_LINK_LIBRARIES(test_netemul ${MATH_LIBS})
37
38####
39## INSTALL section ##
40
41INSTALL(TARGETS test_netemul
42 LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX}
43 COMPONENT freeDiameter-debug-tools)