diff options
Diffstat (limited to 'libs/enet')
-rw-r--r-- | libs/enet/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/enet/CMakeLists.txt b/libs/enet/CMakeLists.txt index 52895918..d7acbcc1 100644 --- a/libs/enet/CMakeLists.txt +++ b/libs/enet/CMakeLists.txt @@ -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) |