Mercurial > hg > freeDiameter
diff cmake/Modules/FindSCTP.cmake @ 8:3e143f047f78
Backup for the week-end
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 18 Sep 2009 18:54:07 +0900 |
parents | 13530e1f02e3 |
children | 397cdcd41f53 |
line wrap: on
line diff
--- a/cmake/Modules/FindSCTP.cmake Fri Sep 04 18:05:25 2009 +0900 +++ b/cmake/Modules/FindSCTP.cmake Fri Sep 18 18:54:07 2009 +0900 @@ -5,25 +5,42 @@ # SCTP_INCLUDE_DIRS - the SCTP include directories # SCTP_LIBRARIES - link these to use SCTP -include(LibFindMacros) - -# Use pkg-config to get hints about paths (Note: not yet supported?) -# libfind_pkg_check_modules(SCTP_PKGCONF sctp) +if (SCTP_INCLUDE_DIRS) + set(SCTP_FIND_QUIETLY TRUE) +endif (SCTP_INCLUDE_DIRS) # Include dir find_path(SCTP_INCLUDE_DIR NAMES netinet/sctp.h - PATHS ${SCTP_PKGCONF_INCLUDE_DIRS} ) -# Finally the library itself +# Library find_library(SCTP_LIBRARY NAMES sctp - PATHS ${SCTP_PKGCONF_LIBRARY_DIRS} ) # Set the include dir variables and the libraries and let libfind_process do the rest. # NOTE: Singular variables for this library, plural for libraries this this lib depends on. -set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR) -set(SCTP_PROCESS_LIBS SCTP_LIBRARY) -libfind_process(SCTP) +#set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR) +#set(SCTP_PROCESS_LIBS SCTP_LIBRARY) +#libfind_process(SCTP) + + +# handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR) + +# If we successfully found the sctp library then add the library to the +# SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing. +IF(SCTP_FOUND) + SET( SCTP_LIBRARIES ${SCTP_LIBRARY} ) +ELSE(SCTP_FOUND) + SET( SCTP_LIBRARIES ) +ENDIF(SCTP_FOUND) + + +# Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables +# only show up under the advanced options in the gui cmake applications. +MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR ) +