Clement Deschamps
Builds for 1 pipeline passed in 5 minutes 58 seconds

removed FindLua.cmake

1 -  
2 -# locate Lua library  
3 -# This module defines  
4 -# LUA_EXECUTABLE, if found  
5 -# LUA_FOUND, if false, do not try to link to Lua  
6 -# LUA_LIBRARIES  
7 -# LUA_INCLUDE_DIR, where to find lua.h  
8 -# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)  
9 -#  
10 -# Note that the expected include convention is  
11 -# #include "lua.h"  
12 -# and not  
13 -# #include <lua/lua.h>  
14 -# This is because, the lua location is not standardized and may exist  
15 -# in locations other than lua/  
16 -  
17 -#=============================================================================  
18 -# Copyright 2007-2009 Kitware, Inc.  
19 -# Modified to support Lua 5.2 by LuaDist 2012  
20 -#  
21 -# Distributed under the OSI-approved BSD License (the "License");  
22 -# see accompanying file Copyright.txt for details.  
23 -#  
24 -# This software is distributed WITHOUT ANY WARRANTY; without even the  
25 -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
26 -# See the License for more information.  
27 -#=============================================================================  
28 -# (To distribute this file outside of CMake, substitute the full  
29 -# License text for the above reference.)  
30 -#  
31 -# The required version of Lua can be specified using the  
32 -# standard syntax, e.g. FIND_PACKAGE(Lua 5.1)  
33 -# Otherwise the module will search for any available Lua implementation  
34 -  
35 -# Always search for non-versioned lua first (recommended)  
36 -SET(_POSSIBLE_LUA_INCLUDE include include/lua)  
37 -SET(_POSSIBLE_LUA_EXECUTABLE lua)  
38 -SET(_POSSIBLE_LUA_LIBRARY lua)  
39 -  
40 -# Determine possible naming suffixes (there is no standard for this)  
41 -IF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)  
42 - SET(_POSSIBLE_SUFFIXES "${Lua_FIND_VERSION_MAJOR}${Lua_FIND_VERSION_MINOR}" "${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}" "-${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}")  
43 -ELSE(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)  
44 - SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "51" "5.1" "-5.1")  
45 -ENDIF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)  
46 -  
47 -# Set up possible search names and locations  
48 -FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES})  
49 - LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}")  
50 - LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}")  
51 - LIST(APPEND _POSSIBLE_LUA_LIBRARY "lua${_SUFFIX}")  
52 -ENDFOREACH(_SUFFIX)  
53 -  
54 -# Find the lua executable  
55 -FIND_PROGRAM(LUA_EXECUTABLE  
56 - NAMES ${_POSSIBLE_LUA_EXECUTABLE}  
57 -)  
58 -  
59 -# Find the lua header  
60 -FIND_PATH(LUA_INCLUDE_DIR lua.h  
61 - HINTS  
62 - $ENV{LUA_DIR}  
63 - PATH_SUFFIXES ${_POSSIBLE_LUA_INCLUDE}  
64 - PATHS  
65 - ~/Library/Frameworks  
66 - /Library/Frameworks  
67 - /usr/local  
68 - /usr  
69 - /sw # Fink  
70 - /opt/local # DarwinPorts  
71 - /opt/csw # Blastwave  
72 - /opt  
73 -)  
74 -  
75 -# Find the lua library  
76 -FIND_LIBRARY(LUA_LIBRARY  
77 - NAMES ${_POSSIBLE_LUA_LIBRARY}  
78 - HINTS  
79 - $ENV{LUA_DIR}  
80 - PATH_SUFFIXES lib64 lib  
81 - PATHS  
82 - ~/Library/Frameworks  
83 - /Library/Frameworks  
84 - /usr/local  
85 - /usr  
86 - /sw  
87 - /opt/local  
88 - /opt/csw  
89 - /opt  
90 -)  
91 -  
92 -IF(LUA_LIBRARY)  
93 - # include the math library for Unix  
94 - IF(UNIX AND NOT APPLE)  
95 - FIND_LIBRARY(LUA_MATH_LIBRARY m)  
96 - SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")  
97 - # For Windows and Mac, don't need to explicitly include the math library  
98 - ELSE(UNIX AND NOT APPLE)  
99 - SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")  
100 - ENDIF(UNIX AND NOT APPLE)  
101 -ENDIF(LUA_LIBRARY)  
102 -  
103 -# Determine Lua version  
104 -IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")  
105 - FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")  
106 -  
107 - STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")  
108 - UNSET(lua_version_str)  
109 -ENDIF()  
110 -  
111 -INCLUDE(FindPackageHandleStandardArgs)  
112 -# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if  
113 -# all listed variables are TRUE  
114 -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua  
115 - REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR  
116 - VERSION_VAR LUA_VERSION_STRING)  
117 -  
118 -MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE)