annotate cmake/Modules/FindSCTP.cmake @ 1534:c83e60f28632

dict_dcca_3gpp: simplify rule creation Refactor local_rules_definition to simplify rule creation (to avoid c99 struct initialisers that result in long lines). No change to generated rules.
author Luke Mewburn <luke@mewburn.net>
date Mon, 20 Apr 2020 12:12:42 +1000
parents d68f27e7e814
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 # - Try to find SCTP library and headers
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 # Once done, this will define
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3 #
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 # SCTP_FOUND - system has SCTP
493
d68f27e7e814 Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 284
diff changeset
5 # SCTP_INCLUDE_DIR - the SCTP include directories
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 # SCTP_LIBRARIES - link these to use SCTP
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7
493
d68f27e7e814 Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 284
diff changeset
8 if (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
9 set(SCTP_FIND_QUIETLY TRUE)
493
d68f27e7e814 Fixed a few CMake variable names
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 284
diff changeset
10 endif (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 # Include dir
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 find_path(SCTP_INCLUDE_DIR
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 NAMES netinet/sctp.h
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15 )
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
17 # Library
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
18 find_library(SCTP_LIBRARY
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
19 NAMES sctp
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
20 )
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
21
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
22 # Set the include dir variables and the libraries and let libfind_process do the rest.
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
23 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
24 #set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
25 #set(SCTP_PROCESS_LIBS SCTP_LIBRARY)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
26 #libfind_process(SCTP)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
27
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
28
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
29 # handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
30 # all listed variables are TRUE
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
31 INCLUDE(FindPackageHandleStandardArgs)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
32 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
33
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
34 # If we successfully found the sctp library then add the library to the
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
35 # SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing.
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
36 IF(SCTP_FOUND)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
37 SET( SCTP_LIBRARIES ${SCTP_LIBRARY} )
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
38 ELSE(SCTP_FOUND)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
39 SET( SCTP_LIBRARIES )
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
40 ENDIF(SCTP_FOUND)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
41
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
42
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
43 # Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
44 # only show up under the advanced options in the gui cmake applications.
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
45 MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR )
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
46
"Welcome to our mercurial repository"