mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 20:12:40 +02:00
Added cmake build files (thanks RCL)
This commit is contained in:
45
mk/cmake/Modules/FindLUA.cmake
Normal file
45
mk/cmake/Modules/FindLUA.cmake
Normal file
@@ -0,0 +1,45 @@
|
||||
# Find the Lua 5.1 includes and library
|
||||
#
|
||||
# LUA_INCLUDE_DIR - where to find lua.h
|
||||
# LUA_LIBRARIES - List of fully qualified libraries to link against
|
||||
# LUA_FOUND - Set to TRUE if found
|
||||
|
||||
# Copyright (c) 2007, Pau Garcia i Quiles, <pgquiles@elpauer.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# [RCL] FIXME: is it future proof with names like lua5.1? Kubuntu does not provide
|
||||
# a generic (version-independent) include directory for LUA...
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
SET(LUA_FIND_QUIETLY TRUE)
|
||||
ENDIF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
|
||||
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.hpp
|
||||
PATHS /usr/include/lua
|
||||
/usr/include/lua5.1
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUA_LIBRARIES NAMES lua5.1 )
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
SET(LUA_FOUND TRUE)
|
||||
INCLUDE(CheckLibraryExists)
|
||||
CHECK_LIBRARY_EXISTS(${LUA_LIBRARIES} lua_close "" LUA_NEED_PREFIX)
|
||||
ELSE(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
SET(LUA_FOUND FALSE)
|
||||
ENDIF (LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
|
||||
IF(LUA_FOUND)
|
||||
IF (NOT LUA_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Lua library: ${LUA_LIBRARIES}")
|
||||
MESSAGE(STATUS "Found Lua headers: ${LUA_INCLUDE_DIR}")
|
||||
ENDIF (NOT LUA_FIND_QUIETLY)
|
||||
ELSE(LUA_FOUND)
|
||||
IF(LUA_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could NOT find Lua")
|
||||
ENDIF(LUA_FIND_REQUIRED)
|
||||
ENDIF(LUA_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES)
|
Reference in New Issue
Block a user