diff --git a/CMakeLists.txt b/CMakeLists.txt index a78da57f..e4457768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ SET(Boost_USE_STATIC_LIBS ON) SET(Boost_USE_MULTITHREADED OFF) FIND_PACKAGE(Boost COMPONENTS system signals REQUIRED) FIND_PACKAGE(OpenGL REQUIRED) -FIND_PACKAGE(Lua51 REQUIRED) +FIND_PACKAGE(Lua REQUIRED) FIND_PACKAGE(YamlCpp REQUIRED) FIND_PACKAGE(PhysFS REQUIRED) FIND_PACKAGE(GMP REQUIRED) diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake index a8686c1e..45dc6d31 100644 --- a/cmake/FindGMP.cmake +++ b/cmake/FindGMP.cmake @@ -1,4 +1,4 @@ -# Try to find the GMP librairies +# Try to find the GMP librairy # GMP_FOUND - system has GMP # GMP_INCLUDE_DIR - the GMP include directory # GMP_LIBRARY - the GMP library diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake new file mode 100644 index 00000000..e1d4849d --- /dev/null +++ b/cmake/FindLua.cmake @@ -0,0 +1,22 @@ +# Try to find the lua librairy +# LUA_FOUND - system has lua +# LUA_INCLUDE_DIR - the lua include directory +# LUA_LIBRARY - the lua library +# LUA_LIBRARIES - the lua library and it's dependencies + +FIND_PATH(LUA_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES lua51 lua5.1) +FIND_LIBRARY(LUA_LIBRARY NAMES liblua51.a liblua5.1.a liblua-5.1.a liblua.a lua51 lua5.1 lua-5.1 lua) + +IF(LUA_LIBRARY) + IF(UNIX AND NOT APPLE) + FIND_LIBRARY(LUA_MATH_LIBRARY m) + SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + ELSE(UNIX AND NOT APPLE) + SET(LUA_LIBRARIES "${LUA_LIBRARY}") + ENDIF(UNIX AND NOT APPLE) +ENDIF(LUA_LIBRARY) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR) +MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) + diff --git a/cmake/FindLua51.cmake b/cmake/FindLua51.cmake deleted file mode 100644 index b66a35a2..00000000 --- a/cmake/FindLua51.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Locate Lua library -# This module defines -# LUA51_FOUND, if false, do not try to link to Lua -# LUA_LIBRARIES -# LUA_INCLUDE_DIR, where to find lua.h -# -# Note that the expected include convention is -# #include "lua.h" -# and not -# #include -# This is because, the lua location is not standardized and may exist -# in locations other than lua/ - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -FIND_PATH(LUA_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES lua51 lua5.1) -FIND_LIBRARY(LUA_LIBRARY NAMES liblua51.a liblua5.1.a liblua-5.1.a liblua.a lua51 lua5.1 lua-5.1 lua) - -IF(LUA_LIBRARY) - # include the math library for Unix - IF(UNIX AND NOT APPLE) - FIND_LIBRARY(LUA_MATH_LIBRARY m) - SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") - # For Windows and Mac, don't need to explicitly include the math library - ELSE(UNIX AND NOT APPLE) - SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") - ENDIF(UNIX AND NOT APPLE) -ENDIF(LUA_LIBRARY) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR) -MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) - diff --git a/cmake/FindPhysFS.cmake b/cmake/FindPhysFS.cmake index e7a5e9b8..44d3c749 100644 --- a/cmake/FindPhysFS.cmake +++ b/cmake/FindPhysFS.cmake @@ -1,27 +1,7 @@ -# Locate PhysFS library -# This module defines -# PHYSFS_LIBRARY, the name of the library to link against -# PHYSFS_FOUND, if false, do not try to link to PHYSFS -# PHYSFS_INCLUDE_DIR, where to find physfs.h -# -# $PHYSFSDIR is an environment variable that would -# correspond to the ./configure --prefix=$PHYSFSDIR -# used in building PHYSFS. -# -# Created by Eric Wing. - -#============================================================================= -# Copyright 2005-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) +# Try to find the physfs librairy +# PHYSFS_FOUND - system has physfs +# PHYSFS_INCLUDE_DIR - the physfs include directory +# PHYSFS_LIBRARY - the physfs library FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h PATH_SUFFIXES physfs) FIND_LIBRARY(PHYSFS_LIBRARY NAMES libphysfs.a physfs) diff --git a/cmake/FindZLIB.cmake b/cmake/FindZLIB.cmake new file mode 100644 index 00000000..6bc28e66 --- /dev/null +++ b/cmake/FindZLIB.cmake @@ -0,0 +1,11 @@ +# Try to find the zlib librairy +# ZLIB_FOUND - system has zlib +# ZLIB_INCLUDE_DIR - the zlib include directory +# ZLIB_LIBRARY - the zlib library + +FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h) +FIND_LIBRARY(ZLIB_LIBRARY NAMES libz.a libzlib.a zlib1.a zlibd.a zlibd1.a z zlib zdll zlib1 zlibd zlibd1) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +