Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindLua.cmake @ 1026

Last change on this file since 1026 was 1021, checked in by bknecht, 17 years ago

merged back that script-branch

File size: 1.5 KB
Line 
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
21FIND_LIBRARY(Lua_LIBRARIES lua5.1
22        /usr/lib
23        /usr/local/lib)
24
25IF (NOT 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/)
30ENDIF (NOT Lua_INCLUDE_DIR)
31MESSAGE(STATUS ${Lua_INCLUDE_DIR})
32
33IF (NOT Lua_LIBRARIES)
34FIND_LIBRARY(Lua_LIBRARIES lua50 lua
35        /usr/lib
36        /usr/local/lib
37        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
38
39FIND_LIBRARY(Lua_LIBRARY lualib50 lualib
40        /usr/lib
41        /usr/local/lib
42        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
43
44MESSAGE(STATUS ${Lua_LIBRARY})
45MESSAGE(STATUS ${Lua_LIBRARIES})
46
47SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
48
49ENDIF (NOT Lua_LIBRARIES)
50
51IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
52    SET(Lua_FOUND TRUE)
53ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
54
55IF (Lua_FOUND)
56    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
57ELSE (Lua_FOUND)
58    IF (Lua_FIND_REQUIRED)
59        MESSAGE(FATAL_ERROR "Could not find Lua")
60    ENDIF (Lua_FIND_REQUIRED)
61ENDIF (Lua_FOUND)
Note: See TracBrowser for help on using the repository browser.