diff options
author | Bertram <bertram@cegetel.net> | 2010-01-28 22:33:54 +0100 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2010-01-28 22:33:54 +0100 |
commit | f7f0f36c3fec7786e15ee79c7aa184c50caa3cd7 (patch) | |
tree | 0832fa62aff4b8760709910c5a156d85edb58224 /CMake | |
parent | a6a20e5bafea3f1252891b4fa2db83a90e25b8e1 (diff) | |
download | manaserv-f7f0f36c3fec7786e15ee79c7aa184c50caa3cd7.tar.gz manaserv-f7f0f36c3fec7786e15ee79c7aa184c50caa3cd7.tar.xz manaserv-f7f0f36c3fec7786e15ee79c7aa184c50caa3cd7.zip |
Added WIP entries for Cmake build. This is configurable but non-working atm.
I'll need a bit more time and help to get this fully working, but it's a good start :)
Also corrected a typo in a makefile.am file.
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/Modules/FindENet.cmake | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/CMake/Modules/FindENet.cmake b/CMake/Modules/FindENet.cmake new file mode 100644 index 0000000..98da51a --- /dev/null +++ b/CMake/Modules/FindENet.cmake @@ -0,0 +1,52 @@ +# - 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) + +# for Windows we rely on the environement variables +# %INCLUDE% and %LIB%; FIND_LIBRARY checks %LIB% +# automatically on Windows +IF(WIN32) + FIND_PATH(ENet_INCLUDE_DIR enet/enet.h + $ENV{INCLUDE} + ) + FIND_LIBRARY(ENet_LIBRARY + NAMES enet + ) +ELSE() + 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 + ) +ENDIF() + +IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) + SET(ENET_FOUND TRUE) + SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR}) + SET(ENET_LIBRARIES ${ENet_LIBRARY}) +ELSE () + SET(ENET_FOUND FALSE) +ENDIF () + +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) |