Changeset 11100
- Timestamp:
- Jan 28, 2016, 3:56:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/tools/FindLua5.1.cmake
r8351 r11100 31 31 INCLUDE(HandleLibraryTypes) 32 32 33 # Macro that determines Lua version. Should work for versions 2.2 and above (current release: 5. 1.4)33 # Macro that determines Lua version. Should work for versions 2.2 and above (current release: 5.3.2) 34 34 FUNCTION(DETERMINE_LUA_VERSION _file _varname) 35 35 IF(EXISTS ${_file}) … … 44 44 STRING(REGEX REPLACE "^.*LUA_VERSION[ \t]+\"Lua[ \t]+([.0-9]+)\".*$" "\\1" ${_varname} "${_file_content}") 45 45 IF(${_varname} STREQUAL "${_file_content}") 46 MESSAGE(FATAL_ERROR "Could not determine Lua version which means this script has a bug") 46 # Last chance, search for LUA_VERSION_MAJOR and LUA_VERSION_MINOR 47 STRING(REGEX REPLACE "^.*LUA_VERSION_MAJOR[ \t]+\"([0-9]+)\".*$" "\\1" _major "${_file_content}") 48 STRING(REGEX REPLACE "^.*LUA_VERSION_MINOR[ \t]+\"([0-9]+)\".*$" "\\1" _minor "${_file_content}") 49 IF(_major STREQUAL "${_file_content}" OR _minor STREQUAL "${_file_content}") 50 MESSAGE(FATAL_ERROR "Could not determine Lua version which means this script has a bug") 51 ENDIF() 52 SET(${_varname} "${_major}.${_minor}") 47 53 ENDIF() 48 54 IF(${_varname} MATCHES "^[0-9]+\\.[0-9]+$") … … 57 63 FIND_PATH(LUA5.1_INCLUDE_DIR lua.h 58 64 PATHS $ENV{LUA5.1_DIR} $ENV{LUA_DIR} 59 PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include65 PATH_SUFFIXES lua5.1 include/lua51 include/lua5.1 include/lua include 60 66 ) 61 67
Note: See TracChangeset
for help on using the changeset viewer.