changeset 324:a18fd5d9a1ec

Fix cmake SCTP support for cases where SCTP is native in the system, as in FreeBSD
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 18 Mar 2009 17:52:19 +0900
parents 74ab9d60d452
children 4e96f59da35f
files waaad/CMakeLists.txt
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/waaad/CMakeLists.txt	Fri Mar 13 10:27:58 2009 +0900
+++ b/waaad/CMakeLists.txt	Wed Mar 18 17:52:19 2009 +0900
@@ -50,9 +50,12 @@
 # We need the IPPROTO_SCTP symbol from sys/socket.h, netinet/in.h or netinet/sctp.h
 OPTION(DISABLE_SCTP "Disable SCTP support?")
 IF(NOT DISABLE_SCTP)
-	FIND_PACKAGE(SCTP REQUIRED)
-	INCLUDE_DIRECTORIES(${SCTP_INCLUDE_DIRS})
-	SET(WAAAD_LIBS ${WAAAD_LIBS} ${SCTP_LIBRARIES})
+	CHECK_FUNCTION_EXISTS(sctp_getladdrs HAVE_NATIVE_SCTP)
+	IF(NOT HAVE_NATIVE_SCTP)
+		FIND_PACKAGE(SCTP REQUIRED)
+		INCLUDE_DIRECTORIES(${SCTP_INCLUDE_DIRS})
+		SET(WAAAD_LIBS ${WAAAD_LIBS} ${SCTP_LIBRARIES})
+	ENDIF(NOT HAVE_NATIVE_SCTP)
 ENDIF(NOT DISABLE_SCTP)
 
 # We need the __BYTE_ORDER definition ( sys/param.h )
"Welcome to our mercurial repository"