Mercurial > hg > freeDiameter
annotate extensions/app_diameap/CMakeLists.txt @ 1418:a51f71694121
fix build with MySQL >= 8.0
MySQL 8.0 deprecated my_bool in favour of C99's bool.
Detect if my_bool is available, and if not, provide
a replacement.
author | Luke Mewburn <luke@mewburn.net> |
---|---|
date | Tue, 18 Feb 2020 20:58:20 +1100 |
parents | 242ee9fe34aa |
children |
rev | line source |
---|---|
425
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
1 # The Diameter EAP Application extension |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
2 PROJECT("Diameter EAP Application extension" C) |
389 | 3 |
1418
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
4 INCLUDE (CheckCSourceCompiles) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
5 |
425
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
6 # Find MySQL |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
7 FIND_PACKAGE(MySQL REQUIRED) |
823
f145c687c5f3
Add explicit requirement on libgcrypt for app_diameap.fdx, this lib no longer comes implicitely with gnutls in the core
Sebastien Decugis <sdecugis@freediameter.net>
parents:
438
diff
changeset
|
8 FIND_PACKAGE(Gcrypt REQUIRED) |
425
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
9 INCLUDE_DIRECTORIES(${MySQL_INCLUDE_DIR}) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
10 |
1418
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
11 # Check for my_bool, deprecated in MySQL 8.0 |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
12 SET(CHECK_MYSQL_MY_BOOL " |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
13 #include <mysql.h> |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
14 int main() { |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
15 my_bool f; |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
16 }") |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
17 SET(CMAKE_REQUIRED_INCLUDES ${MySQL_INCLUDE_DIR}) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
18 SET(CMAKE_REQUIRED_LIBRARIES ${MySQL_LIBRARY}) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
19 CHECK_C_SOURCE_COMPILES("${CHECK_MYSQL_MY_BOOL}" HAVE_MYSQL_MY_BOOL) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
20 IF (HAVE_MYSQL_MY_BOOL) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
21 ADD_DEFINITIONS(-DHAVE_MYSQL_MY_BOOL) |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
22 ENDIF() |
a51f71694121
fix build with MySQL >= 8.0
Luke Mewburn <luke@mewburn.net>
parents:
847
diff
changeset
|
23 |
425
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
24 # Parse plugins |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
25 ADD_SUBDIRECTORY(plugins) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
26 |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
27 # Parser |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
28 BISON_FILE(diameap.y) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
29 FLEX_FILE(diameap.l) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
30 SET_SOURCE_FILES_PROPERTIES(lex.diameap.c diameap.tab.c PROPERTIES COMPILE_FLAGS "-I \"${CMAKE_CURRENT_SOURCE_DIR}\"") |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
31 |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
32 |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
33 set( diameapsrc |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
34 diameap_defs.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
35 diameap.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
36 diameap_server.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
37 diameap_plugins.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
38 diameap_eap.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
39 plugins.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
40 diameap_eappacket.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
41 diameap_user.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
42 diameap.tab.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
43 diameap.tab.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
44 lex.diameap.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
45 diameap.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
46 diameap_server.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
47 diameap_plugins.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
48 diameap_init.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
49 diameap_common.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
50 diameap_eappacket.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
51 libdiameap.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
52 diameap_eap.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
53 diameap_mysql.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
54 diameap_mysql.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
55 diameap_tls.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
56 diameap_tls.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
57 libcrypt.h |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
58 libcrypt.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
59 diameap_user.c |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
60 ) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
61 |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
62 FD_ADD_EXTENSION(app_diameap ${diameapsrc}) |
0c6e50a5291d
New app_diameap Diameter EAP Application
Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp>
parents:
389
diff
changeset
|
63 |
847
242ee9fe34aa
Oops, previous commit was too much actually...
Sebastien Decugis <sdecugis@freediameter.net>
parents:
845
diff
changeset
|
64 TARGET_LINK_LIBRARIES(app_diameap ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} ${MySQL_LIBRARY} ) |
242ee9fe34aa
Oops, previous commit was too much actually...
Sebastien Decugis <sdecugis@freediameter.net>
parents:
845
diff
changeset
|
65 |
431
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
66 #### |
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
67 ## INSTALL section ## |
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
68 |
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
69 INSTALL(TARGETS app_diameap |
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
70 LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} |
1bb1bc417efe
Reworked the packaging to include newest components
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
425
diff
changeset
|
71 COMPONENT freeDiameter-eap-server) |