Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | # The app_acct extension |
| 2 | PROJECT("Simple Accounting server" C) |
| 3 | |
| 4 | ######################## |
| 5 | # Search for libpg (postgresql package) |
| 6 | FIND_PACKAGE(PostgreSQL REQUIRED) |
| 7 | INCLUDE_DIRECTORIES(${POSTGRESQL_INCLUDE_DIR}) |
| 8 | |
| 9 | ######################## |
| 10 | # Parser files |
| 11 | BISON_FILE(acct_conf.y) |
| 12 | FLEX_FILE(acct_conf.l) |
| 13 | SET_SOURCE_FILES_PROPERTIES(lex.acct_conf.c acct_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") |
| 14 | |
| 15 | # List of source files |
| 16 | SET( APP_ACCT_SRC |
| 17 | app_acct.h |
| 18 | app_acct.c |
| 19 | acct_db.c |
| 20 | acct_records.c |
| 21 | ) |
| 22 | SET( APP_ACCT_SRC_GEN |
| 23 | lex.acct_conf.c |
| 24 | acct_conf.tab.c |
| 25 | acct_conf.tab.h |
| 26 | ) |
| 27 | |
| 28 | # Compile as a module |
| 29 | FD_ADD_EXTENSION(app_acct ${APP_ACCT_SRC} ${APP_ACCT_SRC_GEN}) |
| 30 | TARGET_LINK_LIBRARIES(app_acct ${POSTGRESQL_LIBRARIES}) |
| 31 | |
| 32 | |
| 33 | #### |
| 34 | ## INSTALL section ## |
| 35 | |
| 36 | INSTALL(TARGETS app_acct |
| 37 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} |
| 38 | COMPONENT freeDiameter-accounting-server) |