summaryrefslogtreecommitdiff
path: root/CMake/Modules/FindENet.cmake
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-11-01 15:12:22 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-11-01 15:12:22 +0000
commitfa035c2fd70945a0b12143ce9b81284d8d24d13b (patch)
tree13e58b07970e28107b096572fd529b919be8ac38 /CMake/Modules/FindENet.cmake
parente8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3 (diff)
downloadmana-fa035c2fd70945a0b12143ce9b81284d8d24d13b.tar.gz
mana-fa035c2fd70945a0b12143ce9b81284d8d24d13b.tar.bz2
mana-fa035c2fd70945a0b12143ce9b81284d8d24d13b.tar.xz
mana-fa035c2fd70945a0b12143ce9b81284d8d24d13b.zip
Added CMake support
Diffstat (limited to 'CMake/Modules/FindENet.cmake')
-rw-r--r--CMake/Modules/FindENet.cmake41
1 files changed, 41 insertions, 0 deletions
diff --git a/CMake/Modules/FindENet.cmake b/CMake/Modules/FindENet.cmake
new file mode 100644
index 00000000..4d0a06c8
--- /dev/null
+++ b/CMake/Modules/FindENet.cmake
@@ -0,0 +1,41 @@
+# - Try to find enet
+# Once done this will define
+#
+# ENET_FOUND - system has enet
+# ENET_INCLUDE_DIR - the enet include directory
+# ENET_LIBRARIES - the libraries needed to use enet
+# ENET_DEFINITIONS - Compiler switches required for using enet
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+ SET(ENet_FIND_QUIETLY TRUE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+FIND_PATH(ENet_INCLUDE_DIR enet/enet.h
+ /usr/include
+ /usr/local/include
+ )
+
+FIND_LIBRARY(ENet_LIBRARY
+ NAMES enet
+ PATHS /usr/lib /usr/local/lib
+ )
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+ SET(ENET_FOUND TRUE)
+ SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
+ SET(ENET_LIBRARIES ${ENet_LIBRARY})
+ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+ SET(ENET_FOUND TRUE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+IF (ENET_FOUND)
+ IF (NOT ENet_FIND_QUIETLY)
+ MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}")
+ ENDIF (NOT ENet_FIND_QUIETLY)
+ELSE (ENET_FOUND)
+ IF (ENet_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find enet")
+ ENDIF (ENet_FIND_REQUIRED)
+ENDIF (ENET_FOUND)
+
+MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)