Mercurial > hg > freeDiameter
annotate include/freeDiameter/CMakeLists.txt @ 23:db6c40b8b307
Added some code in cnxctx.c mainly
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 20 Oct 2009 17:30:20 +0900 |
parents | ab3c58d88be3 |
children | bd83ce9328ed |
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 # Name of the default configuration file | |
9 OPTION(DEFAULT_CONF_FILE "Default path to configuration file?" OFF) | |
10 | |
11 # Disable SCTP support completly ? | |
23
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
12 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
|
13 IF (NOT DISABLE_SCTP) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
14 OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF) |
db6c40b8b307
Added some code in cnxctx.c mainly
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
17
diff
changeset
|
15 ENDIF (NOT DISABLE_SCTP) |
0 | 16 |
17
ab3c58d88be3
Added proper gcrypt initializer
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
13
diff
changeset
|
17 # Find TODO items in the code easily ? |
13
ef9ef3bf4752
Progress on peer state machine
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
18 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
|
19 |
0 | 20 |
21 ######################## | |
22 # System checks | |
23 | |
24 INCLUDE (CheckLibraryExists) | |
25 INCLUDE (CheckFunctionExists) | |
26 INCLUDE (CheckIncludeFiles) | |
27 INCLUDE (CheckSymbolExists) | |
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 | |
54 # We need the sctp_getladdrs function ( -lsctp ) | |
55 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h | |
56 IF(NOT DISABLE_SCTP) | |
57 CHECK_FUNCTION_EXISTS(sctp_getladdrs HAVE_NATIVE_SCTP) | |
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) | |
63 ENDIF(NOT DISABLE_SCTP) | |
64 | |
65 # Check byte ordering | |
66 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN) | |
67 | |
68 # We need the getopt_long function | |
69 CHECK_FUNCTION_EXISTS (getopt_long HAVE_LONG_OPTIONS) | |
70 IF (NOT HAVE_LONG_OPTIONS) | |
71 MESSAGE(SEND_ERROR "The getopt_long function is not found, please add needed library in build system") | |
72 ENDIF (NOT HAVE_LONG_OPTIONS) | |
73 | |
74 # Check if ntohll is provided on the system | |
75 CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL) | |
76 | |
77 # malloc.h ? | |
78 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) | |
79 | |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
80 # signalent.h ? -- found in strace distrib; just for nice signal names... |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
81 CHECK_INCLUDE_FILES (signalent.h HAVE_SIGNALENT_H) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
82 |
0 | 83 # The default configuration file name |
84 IF (NOT DEFAULT_CONF_FILE) | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
85 SET(DEFAULT_CONF_FILE "freeDiameter.conf") |
0 | 86 ENDIF (NOT DEFAULT_CONF_FILE) |
87 ########################## | |
88 | |
89 # Generate the host.h file | |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
90 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) |
0 | 91 |
92 # Save the FD_LIBS for parent scope | |
93 SET(FD_LIBS ${FD_LIBS} PARENT_SCOPE) |