blob: 415825d85f93fd18911634c668faa790a224105e [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# Name of the subproject
2Project("libfdproto" 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
Javier Bravo Conde13b0e7d2018-07-09 17:08:51 -050010set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
11
Brian Waters13d96012017-12-08 16:53:31 -060012# List of source files for the library
13SET(LFDPROTO_SRC
14 fdproto-internal.h
15 dictionary.c
16 dictionary_functions.c
17 dispatch.c
18 fifo.c
19 init.c
20 lists.c
21 log.c
22 messages.c
23 ostr.c
24 portability.c
25 rt_data.c
26 sessions.c
27 utils.c
28 version.c
Javier Bravo Conde13b0e7d2018-07-09 17:08:51 -050029 hashlist.cpp
Brian Waters13d96012017-12-08 16:53:31 -060030 )
31
32
33# Save the list of files for testcases in the core's directory
34SET(LFDPROTO_SRC ${LFDPROTO_SRC} PARENT_SCOPE)
35
36# Include path
37INCLUDE_DIRECTORIES(${LFDPROTO_INCLUDES})
38
39# Build as a shared library
40ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC})
41
42ADD_DEPENDENCIES(libfdproto version_information)
43
44# Avoid the liblib name, and set the version
45SET_TARGET_PROPERTIES(libfdproto PROPERTIES
46 OUTPUT_NAME "fdproto"
47 SOVERSION ${FD_PROJECT_VERSION_API}
48 VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV}
49 LINK_INTERFACE_LIBRARIES "${LFDPROTO_LINK_INTERFACES}")
50
51# The library itself needs other libraries
52TARGET_LINK_LIBRARIES(libfdproto ${LFDPROTO_LIBS})
53
54
55####
56## INSTALL section ##
57
58INSTALL(TARGETS libfdproto
59 LIBRARY DESTINATION ${INSTALL_LIBRARY_SUFFIX}
60 COMPONENT freeDiameter-common)
61