work around bad version matchig in FindToLua.cmake

This commit is contained in:
Enno Rehling 2017-03-27 21:30:46 +02:00
parent a3cdfef668
commit 3b3379ad4b
1 changed files with 8 additions and 4 deletions

View File

@ -12,10 +12,14 @@ enable_testing()
find_package (LibXml2)
find_package (SQLite3)
find_package (Curses)
find_package (Lua 5.1 REQUIRED)
if (LUA_FOUND)
find_package (ToLua "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" EXACT REQUIRED)
endif(LUA_FOUND)
find_package (ToLua REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
find_package (Lua 5.2 REQUIRED)
elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.1")
find_package (Lua 5.2 REQUIRED)
endif()
endif(TOLUA_FOUND)
add_subdirectory (cJSON)
add_subdirectory (storage)