couch/CMakeLists.txt
2021-01-14 14:36:37 -06:00

38 lines
902 B
CMake

cmake_minimum_required(VERSION 3.13)
project(Couch)
set(CMAKE_MODULE_PATH, ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR/cmake.})
## Find OPENGL packages
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(glfw3 3.3 REQUIRED)
## Find SWIG
find_package(SWIG REQUIRED)
## Find Lua
find_package(Lua REQUIRED)
file(GLOB_RECURSE sources core/*.cpp core/*.h)
file(GLOB shaders shaders/*)
add_compile_definitions(LUA_SCRIPTING)
add_executable(couch ${sources})
include_directories(core)
target_link_libraries(couch glfw)
target_link_libraries(couch OpenGL::GL)
target_link_libraries(couch GLEW)
target_link_libraries(couch lua)
file(COPY shaders DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
include(UseSWIG)
set_property(SOURCE scripting/couch.i PROPERTY CPLUSPLUS ON)
swig_add_library(couchlua
TYPE STATIC
LANGUAGE lua
SOURCES scripting/couch.i)
target_link_libraries(couch couchlua)