From 4544278ca654e705749097d437d8a7bb937453f2 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Wed, 7 Apr 2021 14:18:36 -0500 Subject: [PATCH] Move FindLua to main cmake file --- CMakeLists.txt | 4 ++++ core/CMakeLists.txt | 6 ------ scripting/CMakeLists.txt | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5722a6b..0bff3b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b902283..d3c3e06 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -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 diff --git a/scripting/CMakeLists.txt b/scripting/CMakeLists.txt index 98e1b67..56666b3 100644 --- a/scripting/CMakeLists.txt +++ b/scripting/CMakeLists.txt @@ -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