try fix cmake

This commit is contained in:
Bluub
2021-06-15 17:47:05 +02:00
parent 472f35c4fd
commit 0b98cf771d
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 20)
find_package(Lua QUIET)
if (NOT Lua_FOUND)
if (NOT LUA_FOUND)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../lib/lua)
find_package(Lua REQUIRED)
endif()
+12
View File
@@ -40,6 +40,18 @@ This is because, the lua location is not standardized and may exist in
locations other than lua/
#]=======================================================================]
if (NOT LUA_FOUND)
INCLUDE(FetchContent)
FetchContent_Declare(lua URL https://www.lua.org/ftp/lua-5.4.3.tar.gz)
FetchContent_GetProperties(lua)
if (NOT lua_POPULATED)
SET(FETCHCONTENT_QUIET NO)
FetchContent_Populate(lua)
ADD_SUBDIRECTORY(${lua_SOURCE_DIR})
endif()
endif()
cmake_policy(PUSH) # Policies apply to functions at definition-time
cmake_policy(SET CMP0012 NEW) # For while(TRUE)