Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | # The test_netemul extension |
| 2 | PROJECT("Simple Diameter network emulator proxy extension (latency, PDV, duplicates)" C) |
| 3 | |
| 4 | # Parser files |
| 5 | BISON_FILE(test_netemul.y) |
| 6 | FLEX_FILE(test_netemul.l) |
| 7 | SET_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 |
| 10 | SET( 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 | |
| 19 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) |
| 20 | |
| 21 | # Compile these files as a freeDiameter extension |
| 22 | FD_ADD_EXTENSION(test_netemul ${TNEMUL_SRC}) |
| 23 | |
| 24 | |
| 25 | # math functions |
| 26 | CHECK_FUNCTION_EXISTS (sqrt HAVE_SQRT) |
| 27 | IF (HAVE_SQRT) |
| 28 | SET(MATH_LIBS "") |
| 29 | ELSE (HAVE_SQRT) |
| 30 | CHECK_LIBRARY_EXISTS (m sqrt "" HAVE_LIBM) |
| 31 | IF (HAVE_LIBM) |
| 32 | SET(MATH_LIBS "-lm") |
| 33 | ENDIF (HAVE_LIBM) |
| 34 | ENDIF (HAVE_SQRT) |
| 35 | |
| 36 | TARGET_LINK_LIBRARIES(test_netemul ${MATH_LIBS}) |
| 37 | |
| 38 | #### |
| 39 | ## INSTALL section ## |
| 40 | |
| 41 | INSTALL(TARGETS test_netemul |
| 42 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} |
| 43 | COMPONENT freeDiameter-debug-tools) |