Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add option to use system enet headers

Reviewed-by: Ablu.
  • Loading branch information...
commit d754a64e3839b3888d489046546195792e4ecc34 1 parent 2305ca0
hasufell authored Ablu committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 libs/enet/CMakeLists.txt
11 libs/enet/CMakeLists.txt
View
@@ -1,3 +1,7 @@
+INCLUDE(FindPkgConfig)
+
+OPTION(WITH_BUNDLEDHEADERS "Use bundled enet headers" ON)
+
INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAS_GETHOSTBYNAME_R)
IF(HAS_GETHOSTBYNAME_R EQUAL 1)
@@ -49,7 +53,12 @@ SET (SRCS
win32.c
)
-INCLUDE_DIRECTORIES("include")
+IF (WITH_BUNDLEDHEADERS)
+ INCLUDE_DIRECTORIES("include")
+ELSE (WITH_BUNDLEDHEADERS)
+ PKG_CHECK_MODULES(ENET REQUIRED libenet)
+ INCLUDE_DIRECTORIES("${ENET_INCLUDEDIR}")
+ENDIF()
ADD_LIBRARY(enet STATIC ${SRCS})
IF (BEOS)
Please sign in to comment.
Something went wrong with that request. Please try again.