diff options
author | hasufell <julian.ospald@googlemail.com> | 2012-06-26 00:14:14 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-06-26 06:44:01 +0200 |
commit | d754a64e3839b3888d489046546195792e4ecc34 (patch) | |
tree | c143597501470c452d1fd7cff7f7b2e8b2ddb047 | |
parent | 2305ca095bee6b32c930f71b99d4c1205ceb561b (diff) | |
download | mana-d754a64e3839b3888d489046546195792e4ecc34.tar.gz mana-d754a64e3839b3888d489046546195792e4ecc34.tar.bz2 mana-d754a64e3839b3888d489046546195792e4ecc34.tar.xz mana-d754a64e3839b3888d489046546195792e4ecc34.zip |
add option to use system enet headers
Reviewed-by: Ablu.
-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) |