blob: 503437d8523e1350e8fca3c087c29d4c675a8251 [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# The subproject name
2Project("freeDiameter core library" C)
3
4# Configuration for newer cmake
5cmake_policy(VERSION 2.6)
6if (POLICY CMP0022)
7 cmake_policy(SET CMP0022 OLD)
8endif (POLICY CMP0022)
9
10# Configuration parser
11BISON_FILE(fdd.y)
12FLEX_FILE(fdd.l)
13SET_SOURCE_FILES_PROPERTIES(lex.fdd.c fdd.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}")
14
15# List of source files
16SET(FDCORE_SRC
17 fdcore-internal.h
18 apps.c
19 cnxctx.h
20 config.c
21 core.c
22 cnxctx.c
23 endpoints.c
24 events.c
25 extensions.c
26 fifo_stats.c
27 hooks.c
28 dict_base_proto.c
29 messages.c
30 queues.c
31 peers.c
32 p_ce.c
33 p_cnx.c
34 p_dw.c
35 p_dp.c
36 p_expiry.c
37 p_out.c
38 p_psm.c
39 p_sr.c
40 routing_dispatch.c
41 server.c
42 tcp.c
43 version.c
44 )
45
46IF(NOT DISABLE_SCTP)
47 SET(FDCORE_SRC ${FDCORE_SRC} sctp.c sctp3436.c)
48ENDIF(NOT DISABLE_SCTP)
49
50SET(FDCORE_GEN_SRC
51 lex.fdd.c
52 fdd.tab.c
53 fdd.tab.h
54 )
55
56# Save the list of files for the tests
57SET(FDCORE_SRC ${FDCORE_SRC} PARENT_SCOPE)
58SET(FDCORE_GEN_SRC ${FDCORE_GEN_SRC} PARENT_SCOPE)
59
60# Include path
61INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES})
62INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
63
64# Build the executable
65ADD_LIBRARY(libfdcore SHARED ${FDCORE_SRC} ${FDCORE_GEN_SRC})
66ADD_DEPENDENCIES(libfdcore version_information)
67
68# Avoid the liblib name, and set the version
69SET_TARGET_PROPERTIES(libfdcore PROPERTIES
70 OUTPUT_NAME "fdcore"
71 SOVERSION ${FD_PROJECT_VERSION_API}
72 VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV}
73 LINK_INTERFACE_LIBRARIES "${LFDCORE_LINK_INTERFACES}")
74
75# The library itself needs other libraries
76LINK_DIRECTORIES(${CURRENT_BINARY_DIR}/../libfdproto)
77TARGET_LINK_LIBRARIES(libfdcore libfdproto ${LFDCORE_LIBS})
78
79
80####
81## INSTALL section ##
82
83INSTALL(TARGETS libfdcore
84 LIBRARY DESTINATION ${INSTALL_LIBRARY_SUFFIX}
85 COMPONENT freeDiameter-common)