Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem/cmake/FindLua51.cmake @ 1975

Last change on this file since 1975 was 1975, checked in by adrfried, 16 years ago

lua removed and using extern one

File size: 1.8 KB
Line 
1# Locate Lua library
2# This module defines
3#  LUA_LIBRARIES
4#  LUA_FOUND, if false, do not try to link to Lua
5#  LUA_INCLUDE_DIR, where to find lua.h
6#
7# Note that the expected include convention is
8#  #include "lua.h"
9# and not
10#  #include <lua/lua.h>
11# This is because, the lua location is not standardized and may exist
12# in locations other than lua/
13
14
15FIND_PATH(LUA_INCLUDE_DIR lua.h
16  PATHS
17  $ENV{LUA_DIR}
18  NO_DEFAULT_PATH
19  PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
20)
21
22FIND_PATH(LUA_INCLUDE_DIR lua.h
23  PATHS
24  ~/Library/Frameworks
25  /Library/Frameworks
26  /usr/local
27  /usr
28  /sw # Fink
29  /opt/local # DarwinPorts
30  /opt/csw # Blastwave
31  /opt
32  PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
33)
34
35FIND_LIBRARY(LUA_LIBRARY 
36  NAMES lua51 lua5.1 lua
37  PATHS
38  $ENV{LUA_DIR}
39  NO_DEFAULT_PATH
40    PATH_SUFFIXES lib64 lib
41)
42
43FIND_LIBRARY(LUA_LIBRARY
44  NAMES lua51 lua5.1 lua
45  PATHS
46  ~/Library/Frameworks
47  /Library/Frameworks
48  /usr/local
49  /usr
50  /sw
51  /opt/local
52  /opt/csw
53  /opt
54    PATH_SUFFIXES lib64 lib
55)
56
57IF(LUA_LIBRARY)
58  # include the math library for Unix
59  IF(UNIX AND NOT APPLE)
60    FIND_LIBRARY(LUA_MATH_LIBRARY m)
61    SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
62  # For Windows and Mac, don't need to explicitly include the math library
63  ELSE(UNIX AND NOT APPLE)
64    SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
65  ENDIF(UNIX AND NOT APPLE)
66ENDIF(LUA_LIBRARY)
67
68INCLUDE(FindPackageHandleStandardArgs)
69# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
70# all listed variables are TRUE
71FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua50  DEFAULT_MSG  LUA_LIBRARIES LUA_INCLUDE_DIR)
72
73MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
74
Note: See TracBrowser for help on using the repository browser.