summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake')
-rw-r--r--CMake/Modules/FindENet.cmake41
-rw-r--r--CMake/Modules/FindGuichan.cmake97
-rw-r--r--CMake/Modules/FindLibXml2.cmake59
-rw-r--r--CMake/Modules/FindLibcurl.cmake41
4 files changed, 238 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)
diff --git a/CMake/Modules/FindGuichan.cmake b/CMake/Modules/FindGuichan.cmake
new file mode 100644
index 00000000..fccfc499
--- /dev/null
+++ b/CMake/Modules/FindGuichan.cmake
@@ -0,0 +1,97 @@
+# - Try to find Guichan
+# Once done this will define
+#
+# GUICHAN_FOUND - system has Guichan
+# GUICHAN_INCLUDE_DIR - the Guichan include directory
+# GUICHAN_LIBRARIES - the libraries needed to use Guichan
+#
+# Supported components: SDL OpenGL
+#
+# TODO: Clean up the components stuff and try to add all known
+# components when none are specified. May not bail out for not found
+# components then, set some var instead...
+
+# Be quiet if Guichan was already found
+# We need an extra variable to have the check per component
+IF (Guichan_INCLUDE_DIR AND Guichan_LIBRARY)
+ SET(Guichan_QUIET TRUE)
+ENDIF (Guichan_INCLUDE_DIR AND Guichan_LIBRARY)
+
+
+FIND_PATH(Guichan_INCLUDE_DIR
+ NAMES guichan.hpp
+ PATHS /usr/include /usr/local/include
+ )
+
+FIND_LIBRARY(Guichan_LIBRARY
+ NAMES guichan
+ PATHS /usr/lib /usr/local/lib
+ )
+
+MARK_AS_ADVANCED(Guichan_INCLUDE_DIR Guichan_LIBRARY)
+
+
+IF (Guichan_INCLUDE_DIR AND Guichan_LIBRARY)
+ SET(GUICHAN_FOUND TRUE)
+ SET(GUICHAN_INCLUDE_DIR ${Guichan_INCLUDE_DIR})
+ SET(GUICHAN_LIBRARIES ${Guichan_LIBRARY})
+
+ IF (NOT Guichan_FIND_QUIETLY AND NOT Guichan_QUIET)
+ MESSAGE(STATUS "Found Guichan: ${Guichan_LIBRARY}")
+ ENDIF (NOT Guichan_FIND_QUIETLY AND NOT Guichan_QUIET)
+ENDIF (Guichan_INCLUDE_DIR AND Guichan_LIBRARY)
+
+# Bail out if Guichan is not found but required
+IF (NOT GUICHAN_FOUND AND Guichan_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find Guichan library ${GUICHAN_INCLUDE_DIR}")
+ENDIF (NOT GUICHAN_FOUND AND Guichan_FIND_REQUIRED)
+
+
+# Check for guichan components
+FOREACH (COMPONENT ${Guichan_FIND_COMPONENTS})
+ SET(COMPONENT_FOUND FALSE)
+
+ IF (COMPONENT STREQUAL "SDL")
+ SET(COMPONENT_FOUND TRUE)
+ SET(Guichan_HEADER "guichan/sdl.hpp")
+ SET(Guichan_LIBRARY "guichan_sdl")
+ ENDIF (COMPONENT STREQUAL "SDL")
+
+ IF (COMPONENT STREQUAL "OpenGL")
+ SET(COMPONENT_FOUND TRUE)
+ SET(Guichan_HEADER "guichan/opengl.hpp")
+ SET(Guichan_LIBRARY "guichan_opengl")
+ ENDIF (COMPONENT STREQUAL "OpenGL")
+
+ IF (NOT COMPONENT_FOUND)
+ MESSAGE(FATAL_ERROR "Invalid Guichan component: ${COMPONENT}")
+ ENDIF (NOT COMPONENT_FOUND)
+
+ # Check if we already found this component
+ IF (Guichan_LIBRARY_${COMPONENT})
+ SET(Guichan_QUIET TRUE)
+ ELSE (Guichan_LIBRARY_${COMPONENT})
+ SET(Guichan_QUIET FALSE)
+ ENDIF (Guichan_LIBRARY_${COMPONENT})
+
+ FIND_LIBRARY(Guichan_LIBRARY_${COMPONENT}
+ NAMES ${Guichan_LIBRARY}
+ PATHS /usr/lib /usr/local/lib
+ )
+
+ MARK_AS_ADVANCED(Guichan_LIBRARY_${COMPONENT})
+
+ IF (NOT EXISTS ${Guichan_INCLUDE_DIR}/${Guichan_HEADER} OR
+ NOT Guichan_LIBRARY_${COMPONENT})
+ SET(GUICHAN_FOUND FALSE)
+ MESSAGE(FATAL_ERROR "Could NOT find Guichan component ${COMPONENT}")
+ ENDIF (NOT EXISTS ${Guichan_INCLUDE_DIR}/${Guichan_HEADER} OR
+ NOT Guichan_LIBRARY_${COMPONENT})
+
+ IF (NOT Guichan_FIND_QUIETLY AND NOT Guichan_QUIET)
+ MESSAGE(STATUS "Found Guichan ${COMPONENT}: ${Guichan_LIBRARY_${COMPONENT}}")
+ ENDIF (NOT Guichan_FIND_QUIETLY AND NOT Guichan_QUIET)
+
+ SET(GUICHAN_LIBRARIES ${GUICHAN_LIBRARIES} ${Guichan_LIBRARY_${COMPONENT}})
+ENDFOREACH(COMPONENT)
+
diff --git a/CMake/Modules/FindLibXml2.cmake b/CMake/Modules/FindLibXml2.cmake
new file mode 100644
index 00000000..b45d7293
--- /dev/null
+++ b/CMake/Modules/FindLibXml2.cmake
@@ -0,0 +1,59 @@
+# - Try to find LibXml2
+# Once done this will define
+#
+# LIBXML2_FOUND - system has LibXml2
+# LIBXML2_INCLUDE_DIR - the LibXml2 include directory
+# LIBXML2_LIBRARIES - the libraries needed to use LibXml2
+# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
+#
+# Copyright (c) 2006, Alexander Neundorf <neundorf@kde.org>
+# This code is available under the BSD license, see licenses/BSD for details.
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+ # in cache already
+ SET(LibXml2_FIND_QUIETLY TRUE)
+ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ INCLUDE(UsePkgConfig)
+ PKGCONFIG(libxml-2.0 _LibXml2IncDir _LibXml2LinkDir _LibXml2LinkFlags _LibXml2Cflags)
+ SET(LIBXML2_DEFINITIONS ${_LibXml2Cflags})
+ENDIF (NOT WIN32)
+
+FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
+ PATHS
+ ${_LibXml2IncDir}
+ PATH_SUFFIXES libxml2
+ )
+
+FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
+ PATHS
+ ${_LibXml2LinkDir}
+ )
+
+IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+ SET(LIBXML2_FOUND TRUE)
+ELSE (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+ SET(LIBXML2_FOUND FALSE)
+ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+
+IF (LIBXML2_FOUND)
+ IF (NOT LibXml2_FIND_QUIETLY)
+ MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES}")
+ ENDIF (NOT LibXml2_FIND_QUIETLY)
+ELSE (LIBXML2_FOUND)
+ IF (LibXml2_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could NOT find LibXml2")
+ ENDIF (LibXml2_FIND_REQUIRED)
+ENDIF (LIBXML2_FOUND)
+
+MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)
+
diff --git a/CMake/Modules/FindLibcurl.cmake b/CMake/Modules/FindLibcurl.cmake
new file mode 100644
index 00000000..fe389c49
--- /dev/null
+++ b/CMake/Modules/FindLibcurl.cmake
@@ -0,0 +1,41 @@
+# - Try to find libcurl
+# Once done this will define
+#
+# LIBCURL_FOUND - system has libcurl
+# LIBCURL_INCLUDE_DIR - the libcurl include directory
+# LIBCURL_LIBRARIES - the libraries needed to use libcurl
+# LIBCURL_DEFINITIONS - Compiler switches required for using libcurl
+
+IF (Libcurl_INCLUDE_DIR AND Libcurl_LIBRARY)
+ SET(Libcurl_FIND_QUIETLY TRUE)
+ENDIF (Libcurl_INCLUDE_DIR AND Libcurl_LIBRARY)
+
+FIND_PATH(Libcurl_INCLUDE_DIR curl/curl.h
+ /usr/include
+ /usr/local/include
+ )
+
+FIND_LIBRARY(Libcurl_LIBRARY
+ NAMES curl
+ PATHS /usr/lib /usr/local/lib
+ )
+
+IF (Libcurl_INCLUDE_DIR AND Libcurl_LIBRARY)
+ SET(LIBCURL_FOUND TRUE)
+ SET(LIBCURL_INCLUDE_DIR ${Libcurl_INCLUDE_DIR})
+ SET(LIBCURL_LIBRARIES ${Libcurl_LIBRARY})
+ELSE (Libcurl_INCLUDE_DIR AND Libcurl_LIBRARY)
+ SET(LIBCURL_FOUND TRUE)
+ENDIF (Libcurl_INCLUDE_DIR AND Libcurl_LIBRARY)
+
+IF (LIBCURL_FOUND)
+ IF (NOT Libcurl_FIND_QUIETLY)
+ MESSAGE(STATUS "Found libcurl: ${Libcurl_LIBRARY}")
+ ENDIF (NOT Libcurl_FIND_QUIETLY)
+ELSE (LIBCURL_FOUND)
+ IF (Libcurl_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could NOT find libcurl")
+ ENDIF (Libcurl_FIND_REQUIRED)
+ENDIF (LIBCURL_FOUND)
+
+MARK_AS_ADVANCED(Libcurl_INCLUDE_DIR Libcurl_LIBRARY)