Navigation


source: freeDiameter/CMakeLists.txt @ 1557:7c777b0082ec

1.5.0
Last change on this file since 1557:7c777b0082ec was 1557:7c777b0082ec, checked in by Sebastien Decugis <sdecugis@freediameter.net>, 21 months ago

Update version information for 1.5.0

File size: 4.6 KB
Line 
1# This file is the source for generating the Makefile for the project, using cmake tool (cmake.org)
2
3# Name of the project
4PROJECT("freeDiameter")
5
6# Informations to display in daemon's help
7SET(FD_PROJECT_NAME freeDiameter)
8SET(FD_PROJECT_BINARY freeDiameterd)
9SET(FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2015, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
10
11# Version of the source code
12SET(FD_PROJECT_VERSION_MAJOR 1)
13SET(FD_PROJECT_VERSION_MINOR 5)
14SET(FD_PROJECT_VERSION_REV 0)
15
16# Version of the API with the library
17SET(FD_PROJECT_VERSION_API 6)
18
19# The test framework, using CTest and CDash.
20INCLUDE(CTest)
21
22# CMake version
23CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
24
25# Location of additional CMake modules
26SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
27
28# The default directories
29SET(DEFAULT_CONF_PATH ${CMAKE_INSTALL_PREFIX}/etc/freeDiameter CACHE PATH "Default location of freeDiameter configuration files")
30
31IF (NOT DEFINED LIB_INSTALL_DIR)
32SET(LIB_INSTALL_DIR lib CACHE PATH "Default library path name on the system, to accomodate RPM-based systems that use lib64")
33ENDIF (NOT DEFINED LIB_INSTALL_DIR)
34
35SET(INSTALL_HEADERS_SUFFIX              include/freeDiameter    CACHE PATH "Directory where the headers are installed (relative to CMAKE_INSTALL_PREFIX).")
36SET(INSTALL_DAEMON_SUFFIX               bin                     CACHE PATH "Directory where the daemon binary is installed (relative to CMAKE_INSTALL_PREFIX).")
37SET(INSTALL_LIBRARY_SUFFIX              ${LIB_INSTALL_DIR}                      CACHE PATH "Directory where the freeDiameter libraries are installed (relative to CMAKE_INSTALL_PREFIX).")
38SET(INSTALL_EXTENSIONS_SUFFIX   ${LIB_INSTALL_DIR}/freeDiameter CACHE PATH "Directory where the extensions are installed / searched (relative to CMAKE_INSTALL_PREFIX).")
39
40# All source code should be POSIX 200112L compatible, but some other extensions might be used, so:
41ADD_DEFINITIONS(-D_GNU_SOURCE)
42
43# Set a default build type if none was specified
44if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
45  message(STATUS "Setting build type to 'Debug' as none was specified.")
46  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
47  # Set the possible values of build type for cmake-gui
48  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
49    "MinSizeRel" "RelWithDebInfo" "Profiling" "MaxPerformance" "DebianPackage" "DebugValgrind")
50endif()
51
52# Add a "Profiling" build type
53# SET(CMAKE_BUILD_TYPE Profiling)
54SET(CMAKE_C_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage -fstack-protector -g -Wall")
55
56# Add a "MaxPerformance" build type -- this is very silent...
57# SET(CMAKE_BUILD_TYPE MaxPerformance)
58SET(CMAKE_C_FLAGS_MAXPERFORMANCE "${CMAKE_C_FLAGS_RELEASE} -DSTRIP_DEBUG_CODE")
59
60# Add a "DebianPackage" build type used when creating the Debian packages
61SET(CMAKE_C_FLAGS_DEBIANPACKAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
62
63# Set the "Debug" flags
64SET(CMAKE_C_FLAGS_DEBUG "-Wall -g -O0")
65
66# Add a "DebugValgrind" build type used for checking execution with Valgrind tool
67SET(CMAKE_C_FLAGS_DEBUGVALGRIND "-Wall -g -O0")
68
69# Set the DEBUG flag for Debug and Profiling builds
70IF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind")
71  SET(DEBUG 1)
72ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind")
73
74# Build with fatal warnings?
75IF (ERRORS_ON_WARNINGS)
76  SET(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
77  SET(CMAKE_REQUIRED_FLAGS "-Wno-error ${CMAKE_REQUIRED_FLAGS}")
78ENDIF (ERRORS_ON_WARNINGS)
79
80# some subfolders use yacc and lex parsers
81SET(BISON_GENERATE_DEFINES TRUE)
82SET(BISON_PREFIX_OUTPUTS TRUE)
83INCLUDE(CMakeUserUseBison)
84SET(FLEX_PREFIX_OUTPUTS TRUE)
85INCLUDE(CMakeUserUseFlex)
86IF( NOT BISON_EXECUTABLE OR NOT FLEX_EXECUTABLE )
87  MESSAGE( SEND_ERROR "Bison and Flex are required" )
88ENDIF( NOT BISON_EXECUTABLE OR NOT FLEX_EXECUTABLE )
89# Check that flex is at least 2.5.20 to support bison-bridge
90# how to do the check with cmake???
91
92# Add this to workaround an apparent bug in FreeBSD cmake (already defined in Linux)
93SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-rdynamic")
94
95# For Darwin systems
96IF(APPLE)
97   SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined dynamic_lookup")
98   SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined dynamic_lookup")
99ENDIF(APPLE)
100
101# Location for the include files
102INCLUDE_DIRECTORIES(include)
103INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
104SUBDIRS(include/freeDiameter)
105
106# Location for the source code
107SUBDIRS(libfdproto)
108SUBDIRS(libfdcore)
109SUBDIRS(freeDiameterd)
110
111# Extensions (there is no use of freeDiameter without any extension)
112SUBDIRS(extensions)
113
114# The unary tests directory
115IF ( BUILD_TESTING )
116        SUBDIRS(tests)
117ENDIF ( BUILD_TESTING )
Note: See TracBrowser for help on using the repository browser.