Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/script/cmake/FindLua.cmake @ 968

Last change on this file since 968 was 956, checked in by bknecht, 17 years ago

loads level from file and creates lua code from XML code. not tested yet though

File size: 1.4 KB
RevLine 
[946]1# Find Lua includes and library
2#
3# This module defines
4#  Lua_INCLUDE_DIR
5#  Lua_LIBRARIES, the libraries to link against to use Lua.
6#  Lua_LIB_DIR, the location of the libraries
7#  Lua_FOUND, If false, do not try to use Lua
8#
9# Copyright © 2007, Matt Williams
10#
11# Redistribution and use is allowed according to the terms of the BSD license.
12
13IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
14    SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent
15ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
16
17FIND_PATH(Lua_INCLUDE_DIR lua.h
18        /usr/include/lua5.1
19        /usr/local/include/lua5.1)
20
[954]21FIND_LIBRARY(Lua_LIBRARIES lua5.1
22        /usr/lib
23        /usr/local/lib)
[946]24
[954]25IF (NOT Lua_LIBRARIES AND Lua_INCLUDE_DIR)
26FIND_PATH(Lua_INCLUDE_DIR lua.h
27        /usr/include/lua50
28        /usr/local/include/lua50
29        /usr/pack/lua-5.0.3-sd/include/)
30
31FIND_LIBRARY(Lua_LIBRARIES lua50
[946]32        /usr/lib
[954]33        /usr/local/lib
34        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
[946]35
[954]36FIND_LIBRARY(Lua_LIBRARY lualib50
37        /usr/lib
38        /usr/local/lib
39        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
[946]40
[954]41SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
42
43ENDIF (NOT Lua_LIBRARIES AND Lua_INCLUDE_DIR)
44
[946]45IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
46    SET(Lua_FOUND TRUE)
47ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
48
49IF (Lua_FOUND)
50    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
51ELSE (Lua_FOUND)
52    IF (Lua_FIND_REQUIRED)
53        MESSAGE(FATAL_ERROR "Could not find Lua")
54    ENDIF (Lua_FIND_REQUIRED)
55ENDIF (Lua_FOUND)
Note: See TracBrowser for help on using the repository browser.