Mercurial > hg > freeDiameter
annotate include/freeDiameter/CMakeLists.txt @ 305:61f78fdbacc2
Cleanup vars names
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 14 May 2010 18:05:43 +0900 |
parents | ad3c46016584 |
children | 6fd1e6f56af5 |
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 | 2 |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
3 Project("freeDiameter include directory" C) |
0 | 4 |
5 ######################## | |
6 # Configurable parameters | |
7 | |
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 | 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 |
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
|
18 MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO) |
0 | 19 |
20 ######################## | |
21 # System checks | |
22 | |
23 INCLUDE (CheckLibraryExists) | |
24 INCLUDE (CheckFunctionExists) | |
25 INCLUDE (CheckIncludeFiles) | |
26 INCLUDE (CheckSymbolExists) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
27 INCLUDE (CheckCSourceCompiles) |
0 | 28 INCLUDE (TestBigEndian) |
29 | |
30 # We use dlopen and dlclose | |
31 SET(FD_LIBS ${FD_LIBS} ${CMAKE_DL_LIBS}) | |
32 | |
33 # We need the threads library (pthread) | |
34 INCLUDE(FindThreads) | |
35 SET(FD_LIBS ${FD_LIBS} ${CMAKE_THREAD_LIBS_INIT}) | |
36 | |
37 # We need the clock_gettime function ( -lrt, -lposix4 ) | |
38 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME) | |
39 IF (HAVE_CLOCK_GETTIME) | |
40 SET(CLOCK_GETTIME_LIBS "") | |
41 ELSE (HAVE_CLOCK_GETTIME) | |
42 CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT) | |
43 IF (HAVE_LIBRT) | |
44 SET(CLOCK_GETTIME_LIBS "-lrt") | |
45 ELSE (HAVE_LIBRT) | |
46 CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4) | |
47 IF (HAVE_LIBPOSIX4) | |
48 SET(CLOCK_GETTIME_LIBS "-lposix4") | |
49 ENDIF (HAVE_LIBPOSIX4) | |
50 ENDIF (HAVE_LIBRT) | |
51 ENDIF (HAVE_CLOCK_GETTIME) | |
52 SET(FD_LIBS ${FD_LIBS} ${CLOCK_GETTIME_LIBS}) | |
53 | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
54 # We need the sctp_connectx function among others |
0 | 55 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h |
56 IF(NOT DISABLE_SCTP) | |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
57 CHECK_FUNCTION_EXISTS(sctp_connectx HAVE_NATIVE_SCTP) |
0 | 58 IF(NOT HAVE_NATIVE_SCTP) |
59 FIND_PACKAGE(SCTP REQUIRED) | |
60 INCLUDE_DIRECTORIES(${SCTP_INCLUDE_DIRS}) | |
61 SET(FD_LIBS ${FD_LIBS} ${SCTP_LIBRARIES}) | |
62 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
|
63 # 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
|
64 SET(CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE " |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
65 #include <unistd.h> |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
51
diff
changeset
|
66 #include <netinet/sctp.h> |
51
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
67 int main() { |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
68 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
|
69 } |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
70 ") |
08d8cbeff30b
Fix for number of args to sctp_connectx
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
24
diff
changeset
|
71 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
|
72 CHECK_C_SOURCE_COMPILES("${CHECK_SCTP_CONNECTX_4_ARGS_SOURCE_CODE}" SCTP_CONNECTX_4_ARGS) |
305 | 73 ELSE (NOT DISABLE_SCTP) |
74 MESSAGE(STATUS "Disabled SCTP support.") | |
0 | 75 ENDIF(NOT DISABLE_SCTP) |
76 | |
77 # Check byte ordering | |
78 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN) | |
79 | |
80 # We need the getopt_long function | |
81 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS) | |
82 IF (NOT HAVE_LONG_OPTIONS) | |
83 MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system") | |
84 ENDIF (NOT HAVE_LONG_OPTIONS) | |
85 | |
86 # Check if ntohll is provided on the system | |
87 CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL) | |
88 | |
89 # malloc.h ? | |
90 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) | |
91 | |
92 ########################## | |
305 | 93 # rename this var for the file |
94 SET(DEFAULT_EXTENSIONS_PATH ${INSTALL_EXTENSIONS_PATH}) | |
95 | |
96 ########################## | |
0 | 97 |
98 # Generate the host.h file | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
99 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) |
0 | 100 |
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
|
101 # Save some variables for the other directories |
0 | 102 SET(FD_LIBS ${FD_LIBS} PARENT_SCOPE) |
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
|
103 |
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
|
104 #### |
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
|
105 ## 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
|
106 |
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
|
107 # The headers from this directory are required to develop new extensions for freeDiameter. |
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
|
108 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfreeDiameter.h freeDiameter.h extension.h |
305 | 109 DESTINATION ${INSTALL_HEADERS_PATH} |
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
|
110 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
|
111 |