annotate include/freeDiameter/CMakeLists.txt @ 707:e387d5c6b6f5

Added support for Internationalized Domain Names (IDNA) using GNU libidn
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 09 Feb 2011 18:08:54 +0900
parents fdce8d4575b7
children 958d3efb45b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
1 #CMake configuration for freeDiameter include directory
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
3 Project("freeDiameter includes directory" C)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
5 ########################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 # Configurable parameters
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 # Disable SCTP support completly ?
23
db6c40b8b307 Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 17
diff changeset
9 OPTION(DISABLE_SCTP "Disable SCTP support?" OFF)
db6c40b8b307 Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 17
diff changeset
10 IF (NOT DISABLE_SCTP)
db6c40b8b307 Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 17
diff changeset
11 OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF)
24
bd83ce9328ed Cleanups and completed sctp code (not finished)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 23
diff changeset
12 OPTION(SCTP_USE_MAPPED_ADDRESSES "Use v6-mapped v4 addresses in SCTP (workaround some SCTP limitations)?" OFF)
23
db6c40b8b307 Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 17
diff changeset
13 ENDIF (NOT DISABLE_SCTP)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14
17
ab3c58d88be3 Added proper gcrypt initializer
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 13
diff changeset
15 # Find TODO items in the code easily ?
13
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
16 OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF)
ef9ef3bf4752 Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 8
diff changeset
17
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
18 # Create the absolute path for searching extensions
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
19 SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX})
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
20
707
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
21 # IDNA considerations
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
22 OPTION(DIAMID_IDNA_IGNORE "Ignore completly invalid characters in Diameter Identities (process blindly)?" OFF)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
23 IF (NOT DIAMID_IDNA_IGNORE)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
24 OPTION (DIAMID_IDNA_REJECT "Reject internationalized Diameter Identities, do not attempt to convert it (stringprep) ?" OFF)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
25 ENDIF (NOT DIAMID_IDNA_IGNORE)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
26
707
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
27 MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
28
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
29 ########################
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
30 ### System checks part
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
31
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
32 INCLUDE (CheckLibraryExists)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
33 INCLUDE (CheckFunctionExists)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34 INCLUDE (CheckIncludeFiles)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35 INCLUDE (CheckSymbolExists)
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
36 INCLUDE (CheckCSourceCompiles)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37 INCLUDE (TestBigEndian)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
39
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
40 ### System checks -- mandatory support
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
41
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
42 # We need the getopt_long function
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
43 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS)
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
44 IF (NOT HAVE_LONG_OPTIONS)
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
45 MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system")
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
46 ENDIF (NOT HAVE_LONG_OPTIONS)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
47
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
48 # getifaddrs ?
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
49 CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
50 IF (NOT HAVE_GETIFADDRS)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
51 MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.")
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
52 ENDIF (NOT HAVE_GETIFADDRS)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
53
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
54
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
55 ### System checks -- for freeDiameter-host.h
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
56
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
57 # Check byte ordering
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
58 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
59
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
60 # Check if ntohll is provided on the system
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
61 CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL)
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
62
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
63 # malloc.h ?
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
64 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
65
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
66
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
67 ### System checks -- for includes / link
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
68
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
69 # pthreads
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
70 INCLUDE(FindThreads)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
71 SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
72
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
73 # clock_gettime
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
74 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
75 IF (HAVE_CLOCK_GETTIME)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
76 SET(CLOCK_GETTIME_LIBS "")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
77 ELSE (HAVE_CLOCK_GETTIME)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
78 CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
79 IF (HAVE_LIBRT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
80 SET(CLOCK_GETTIME_LIBS "-lrt")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
81 ELSE (HAVE_LIBRT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
82 CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
83 IF (HAVE_LIBPOSIX4)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
84 SET(CLOCK_GETTIME_LIBS "-lposix4")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
85 ENDIF (HAVE_LIBPOSIX4)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
86 ENDIF (HAVE_LIBRT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
87 ENDIF (HAVE_CLOCK_GETTIME)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
88 SET(CLOCK_GETTIME_LIBS ${CLOCK_GETTIME_LIBS} PARENT_SCOPE)
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
89
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 313
diff changeset
90 # dlopen and dlclose: CMAKE_DL_LIBS
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
91
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
92 # We need the sctp_connectx function among others
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
93 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
94 IF(NOT DISABLE_SCTP)
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
95 CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
96 IF(NOT HAVE_NATIVE_SCTP)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
97 FIND_PACKAGE(SCTP REQUIRED)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
98 ENDIF(NOT HAVE_NATIVE_SCTP)
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
99 # Now check the number of args of this function, since it changed between Ubuntu 9.04 and 9.10
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
100 SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE "
168
6db078b955e3 Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 51
diff changeset
101 #include <unistd.h>
6db078b955e3 Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 51
diff changeset
102 #include <netinet/sctp.h>
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
103 int main() {
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
104 return sctp_connectx(0, NULL, 0, NULL);
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
105 }
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
106 ")
493
d68f27e7e814 Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 492
diff changeset
107 SET(CMAKE_REQUIRED_INCLUDES ${SCTP_INCLUDE_DIR})
51
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
108 SET(CMAKE_REQUIRED_LIBRARIES ${SCTP_LIBRARIES})
08d8cbeff30b Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 24
diff changeset
109 CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS)
305
61f78fdbacc2 Cleanup vars names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
110 ELSE (NOT DISABLE_SCTP)
61f78fdbacc2 Cleanup vars names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
111 MESSAGE(STATUS "Disabled SCTP support.")
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
112 ENDIF(NOT DISABLE_SCTP)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
113 SET(SCTP_INCLUDE_DIR ${SCTP_INCLUDE_DIR} PARENT_SCOPE)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
114 SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
115
707
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
116 # IDNA process: we use libidn from GNU (unless the function & header files are included in libc)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
117 IF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
118 FIND_PACKAGE(IDNA)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
119 SET(CHECK_IDNA_SOURCE_CODE "
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
120 #include <idna.h>
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
121 int main() {
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
122 return idna_to_ascii_8z(NULL, NULL, 0);
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
123 }
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
124 ")
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
125 SET(CMAKE_REQUIRED_INCLUDES ${IDNA_INCLUDE_DIR})
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
126 SET(CMAKE_REQUIRED_LIBRARIES ${IDNA_LIBRARIES})
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
127 CHECK_C_SOURCE_COMPILES("${CHECK_IDNA_SOURCE_CODE}" HAS_IDNA_SUPPORT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
128 IF(NOT HAS_IDNA_SUPPORT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
129 MESSAGE(SEND_ERROR "Unable to find idna.h header or idna_to_ascii_8z function, please install libidn-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT")
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
130 ENDIF(NOT HAS_IDNA_SUPPORT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
131 ELSE (NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
132 MESSAGE(STATUS "Non-default Internationalized Domain Names (IDN) behavior selected (no stringprep).")
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
133 ENDIF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
134 SET(IDNA_INCLUDE_DIR ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
135 SET(IDNA_LIBRARIES ${IDNA_LIBRARIES} PARENT_SCOPE)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
136
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
137
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
138 # Require GNU TLS for building the library
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
139 FIND_PACKAGE(GnuTLS REQUIRED)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
140 SET(GNUTLS_INCLUDE_DIR ${GNUTLS_INCLUDE_DIR} PARENT_SCOPE)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
141 SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES} PARENT_SCOPE)
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
142
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
143 find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h)
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
144 If ( NOT GCRYPT_INCLUDE_DIR )
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
145 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent")
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
146 Endif ( NOT GCRYPT_INCLUDE_DIR )
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
147 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
148 SET(GCRYPT_INCLUDE_DIR ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
149
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
150 # Also we need libgcrypt to... display its version :(
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
151 find_library(GCRYPT_LIBRARY
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
152 NAMES gcrypt
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
153 )
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
154 If ( NOT GCRYPT_LIBRARY )
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
155 MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent")
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
156 Endif ( NOT GCRYPT_LIBRARY )
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
157 SET(GCRYPT_LIBRARY ${GCRYPT_LIBRARY} PARENT_SCOPE)
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
158
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
159
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
160 ##########################
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
161
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
162 # LFDPROTO_LIBS = libraries required by the libfdproto.
707
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
163 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE)
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
164 # And includes paths
e387d5c6b6f5 Added support for Internationalized Domain Names (IDNA) using GNU libidn
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 677
diff changeset
165 SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
166 # Dependencies: the libraries required by any code linking to libfdproto.
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
167 SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
168
668
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
169 # LFDCORE_LIBS = libraries required by the libfdcore (in addition to libfdproto and its dependencies)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
170 SET(LFDCORE_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
171 # And includes paths
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
172 SET(LFDCORE_INCLUDES ${SCTP_INCLUDE_DIR} ${GNUTLS_INCLUDE_DIR} ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
4ef3b7cdf734 Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 666
diff changeset
173 # And dependencies
677
fdce8d4575b7 Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
174 SET(LFDCORE_LINK_INTERFACES "" PARENT_SCOPE)
fdce8d4575b7 Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
175 # We don't force other libraries, the programs will link with what it needs
fdce8d4575b7 Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
176 # (such as libgnutls if it uses GNUTLS_DEBUG() macro
fdce8d4575b7 Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
177 # or libfdproto if it uses some of its interfaces directly)
fdce8d4575b7 Cleanup link commands for Fedora
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
178 # See freeDiameterd/CMakeLists.txt for an example.
305
61f78fdbacc2 Cleanup vars names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
179
61f78fdbacc2 Cleanup vars names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
180 ##########################
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
181
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
182 # Generate the host.h file
1
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
183 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
184
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: 236
diff changeset
185 ####
ad3c46016584 Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 236
diff changeset
186 ## INSTALL section ##
ad3c46016584 Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 236
diff changeset
187
ad3c46016584 Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 236
diff changeset
188 # The headers from this directory are required to develop new extensions for freeDiameter.
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 561
diff changeset
189 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfdproto.h libfdcore.h extension.h
313
6fd1e6f56af5 Completed initial debianization
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 305
diff changeset
190 DESTINATION ${INSTALL_HEADERS_SUFFIX}
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: 236
diff changeset
191 COMPONENT freeDiameter-dev)
ad3c46016584 Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 236
diff changeset
192
"Welcome to our mercurial repository"