Mercurial > hg > freeDiameter
annotate extensions/CMakeLists.txt @ 583:7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Thu, 28 Oct 2010 12:59:03 +0900 |
parents | bc25e91e1e3c |
children | e141506deef8 |
rev | line source |
---|---|
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
1 PROJECT("freeDiameter extensions" C) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
2 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
3 # We want all resulting objects in the same folder |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
4 SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
5 |
9
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
6 # Use the macro FD_ADD_EXTENSION(name files...) to create an extension |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
7 # It is equivalent to add_library with the appropriate parameters |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
8 # and naming conventions (.fdx : FreeDiameter eXtension) |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
9 MACRO(FD_ADD_EXTENSION EXTNAME) |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
10 ADD_LIBRARY(${EXTNAME} MODULE ${ARGN}) |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
11 SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES PREFIX "" ) |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
12 SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES SUFFIX ".fdx" ) |
fc7c18867cf7
New extension mechanism committed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
13 ENDMACRO(FD_ADD_EXTENSION) |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
14 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
15 # Use the macro FD_EXTENSION_SUBDIR(extmacroname subdir descr default) to |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
16 # add a new extension subdirectory. |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
17 MACRO(FD_EXTENSION_SUBDIR EXTSUBDIR EXTDESCR EXTDEFAULT) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
18 STRING(TOUPPER ${EXTSUBDIR} EXTMACRONAME) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
19 IF (NOT ALL_EXTENSIONS) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
20 OPTION(BUILD_${EXTMACRONAME} "Build ${EXTSUBDIR}.fdx? (${EXTDESCR})" ${EXTDEFAULT}) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
21 ENDIF (NOT ALL_EXTENSIONS) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
22 IF (BUILD_${EXTMACRONAME} OR ALL_EXTENSIONS) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
23 SUBDIRS(${EXTSUBDIR}) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
24 ENDIF (BUILD_${EXTMACRONAME} OR ALL_EXTENSIONS) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
25 ENDMACRO(FD_EXTENSION_SUBDIR) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
26 |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
27 OPTION(ALL_EXTENSIONS "Build ALL available extensions? (disable to select individual components)" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
28 |
238
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
29 # The extensions include the headers of freeDiameter that contains gnutls objects |
283
f433bc04eb6a
Renamed module to align with distribution shiped file
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
279
diff
changeset
|
30 FIND_PACKAGE(GnuTLS REQUIRED) |
493
d68f27e7e814
Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
31 INCLUDE_DIRECTORIES(${GNUTLS_INCLUDE_DIR}) |
238
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
32 find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h) |
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
33 If ( NOT GCRYPT_INCLUDE_DIR ) |
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
34 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") |
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
35 Endif ( NOT GCRYPT_INCLUDE_DIR ) |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
283
diff
changeset
|
36 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) |
238
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
37 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR}) |
62eaf631eb61
Fix compilation issue when gnutls is not in standard directory
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
38 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
39 |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
40 ########################### |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
41 # Extensions section |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
42 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
43 #### |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
44 # Diameter applications dictionaries |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
45 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
46 FD_EXTENSION_SUBDIR(dict_nasreq "NASREQ (RFC4005) Dictionary definitions?" ON) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
47 FD_EXTENSION_SUBDIR(dict_eap "Diameter EAP (RFC4072) Dictionary definitions?" ON) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
48 FD_EXTENSION_SUBDIR(dict_sip "Diameter SIP (RFC4740) Dictionary definitions?" ON) |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
49 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
50 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
51 #### |
254
a857024cb48b
Ported the RADIUS/Diameter translation code from waaad project. Not tested yet. Gateway plugins to come later.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
238
diff
changeset
|
52 # Diameter applications |
a857024cb48b
Ported the RADIUS/Diameter translation code from waaad project. Not tested yet. Gateway plugins to come later.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
238
diff
changeset
|
53 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
54 FD_EXTENSION_SUBDIR(app_acct "Simple accounting application that stores accounting records in flat database" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
55 FD_EXTENSION_SUBDIR(app_diameap "Diameter EAP Application server (RFC 4072)" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
56 FD_EXTENSION_SUBDIR(app_radgw "RADIUS/Diameter gateway translation - RADIUS client to Diameter server" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
57 FD_EXTENSION_SUBDIR(app_sip "Diameter SIP Authentication and Authorization server (RFC 4740)" OFF) |
283
f433bc04eb6a
Renamed module to align with distribution shiped file
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
279
diff
changeset
|
58 |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
59 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
60 #### |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
61 # Routing extensions |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
62 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
63 FD_EXTENSION_SUBDIR(rt_default "Configurable routing rules for freeDiameter" ON) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
64 FD_EXTENSION_SUBDIR(rt_ereg "Configurable routing based on regexp matching of AVP values" OFF) |
514
179ef7de53de
New extension: load-balancing based on numerical user-name AVP values
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
493
diff
changeset
|
65 |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
66 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
67 #### |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
68 # Peers security extensions |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
69 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
70 FD_EXTENSION_SUBDIR(acl_wl "White-list based authorization of incoming connections" ON) |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
71 |
254
a857024cb48b
Ported the RADIUS/Diameter translation code from waaad project. Not tested yet. Gateway plugins to come later.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
238
diff
changeset
|
72 |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
73 #### |
254
a857024cb48b
Ported the RADIUS/Diameter translation code from waaad project. Not tested yet. Gateway plugins to come later.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
238
diff
changeset
|
74 # Debug & test extensions |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
75 |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
76 FD_EXTENSION_SUBDIR(dbg_monitor "Outputs periodical status information" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
77 FD_EXTENSION_SUBDIR(dbg_rt "Routing extension for debugging the routing module" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
78 FD_EXTENSION_SUBDIR(test_app "Testing application to send dummy message to another peer, like a Diameter 'ping'" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
79 FD_EXTENSION_SUBDIR(test_sip "Testing application to simulate Diameter-SIP client (RFC4740)" OFF) |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
80 |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
81 |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
283
diff
changeset
|
82 # The following extension have very little use except for specific tests, so we disable them except in Debug configurations. |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
283
diff
changeset
|
83 IF (CMAKE_BUILD_TYPE MATCHES "Debug") |
583
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
84 FD_EXTENSION_SUBDIR(_sample "Simple extension to demonstrate extension mechanism, for developpers" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
85 FD_EXTENSION_SUBDIR(test_acct "Receive Accounting-Requests and display the data, but no storage" OFF) |
7d431a751d6c
Added the ALL_EXTENSIONS build option; and simplified some CMakeFile directives
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
524
diff
changeset
|
86 FD_EXTENSION_SUBDIR(test_rt_any "Routing extension randomly sending message to any peer available, for testing purpose" OFF) |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
283
diff
changeset
|
87 ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug") |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
283
diff
changeset
|
88 |