Move FindLua to main cmake file

This commit is contained in:
Dane Johnson 2021-04-07 14:18:36 -05:00
parent 4a6efb8d98
commit 4544278ca6
3 changed files with 4 additions and 8 deletions

View File

@ -7,6 +7,10 @@ set(CMAKE_CXX_FLAGS_RELEASE -O2)
option(LUA_ENABLED "Lua scripting support" ON)
if (LUA_ENABLED)
add_compile_definitions(LUA_SCRIPTING)
## Find Lua
## Do it here because it's needed in a bunch of places and the debian cmake is a stickler
find_package(Lua REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
endif ()
add_executable(couch core/couch.cpp)

View File

@ -11,12 +11,6 @@ find_package(Bullet REQUIRED)
## Find AssImp
find_package(ASSIMP REQUIRED)
if (LUA_ENABLED)
## Find Lua
find_package(Lua REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
endif ()
add_library(couchlib STATIC)
target_sources(couchlib PUBLIC
Camera.h

View File

@ -5,8 +5,6 @@ set_property(SOURCE couch.i PROPERTY USE_TARGET_INCLUDE_DIRECTORIES ON)
if (LUA_ENABLED)
## Find Lua
find_package(Lua REQUIRED)
swig_add_library(couchlua
TYPE STATIC
LANGUAGE lua