couch/CMakeLists.txt

64 lines
1.5 KiB
CMake
Raw Normal View History

2021-01-14 14:36:37 -06:00
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)
2021-01-24 22:55:36 -06:00
## Find Bullet
find_package(Bullet REQUIRED)
include_directories(${BULLET_INCLUDE_DIRS})
2021-01-14 14:36:37 -06:00
## Find Lua
find_package(Lua REQUIRED)
file(GLOB_RECURSE sources core/*.cpp core/*.h)
add_compile_definitions(LUA_SCRIPTING)
add_executable(couch ${sources})
include_directories(core)
if(NOT WIN32)
target_link_libraries(couch glfw)
endif()
2021-01-14 14:36:37 -06:00
target_link_libraries(couch OpenGL::GL)
2021-01-14 18:31:18 -06:00
target_link_libraries(couch GLEW::GLEW)
target_link_libraries(couch ${LUA_LIBRARIES})
2021-01-24 22:55:36 -06:00
target_link_libraries(couch ${BULLET_LIBRARIES})
2021-01-14 14:36:37 -06:00
include(UseSWIG)
set_property(SOURCE scripting/couch.i PROPERTY CPLUSPLUS ON)
2021-01-20 20:49:12 -06:00
if (NOT WIN32)
2021-01-14 14:36:37 -06:00
swig_add_library(couchlua
2021-01-20 17:37:56 -06:00
TYPE SHARED
2021-01-14 14:36:37 -06:00
LANGUAGE lua
SOURCES scripting/couch.i scripting/lua/helpers.i)
2021-01-20 20:49:12 -06:00
else()
swig_add_library(couchlua
TYPE STATIC
LANGUAGE lua
SOURCES scripting/couch.i scripting/lua/helpers.i)
endif()
2021-01-14 18:31:18 -06:00
target_link_libraries(couchlua ${LUA_LIBRARIES})
2021-01-14 14:36:37 -06:00
target_link_libraries(couch couchlua)
add_subdirectory(thirdparty)
add_subdirectory(shaders)
2021-01-18 18:25:47 -06:00
add_dependencies(couch shader_headers)
target_include_directories(couch
2021-01-18 18:25:47 -06:00
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/shaders/")
if(WIN32)
target_link_libraries(couch glfw3dll)
target_link_libraries(couch ssp)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
endif(WIN32)
2021-01-20 17:37:56 -06:00
install(TARGETS couch couchlua)