2021-01-14 14:36:37 -06:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
project(Couch)
|
2021-02-05 11:22:37 -06:00
|
|
|
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
|
2021-01-14 14:36:37 -06:00
|
|
|
|
2021-04-03 19:12:53 -05:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE -O2)
|
|
|
|
|
2021-01-27 16:05:46 -06:00
|
|
|
option(LUA_ENABLED "Lua scripting support" ON)
|
|
|
|
if (LUA_ENABLED)
|
|
|
|
add_compile_definitions(LUA_SCRIPTING)
|
2021-04-07 14:18:36 -05:00
|
|
|
## 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})
|
2021-01-27 16:05:46 -06:00
|
|
|
endif ()
|
2021-01-26 16:42:28 -06:00
|
|
|
add_executable(couch core/couch.cpp)
|
2021-01-14 14:36:37 -06:00
|
|
|
|
2021-01-26 16:42:28 -06:00
|
|
|
add_subdirectory(core)
|
|
|
|
target_link_libraries(couch couchlib)
|
2021-03-02 15:03:55 -06:00
|
|
|
target_link_libraries(couch couchlib_luascripting)
|
2021-01-20 20:49:12 -06:00
|
|
|
|
2021-01-26 16:42:28 -06:00
|
|
|
add_subdirectory(scripting)
|
2021-01-27 16:05:46 -06:00
|
|
|
if (LUA_ENABLED)
|
|
|
|
target_link_libraries(couch couchlua)
|
|
|
|
endif()
|
2021-01-14 14:36:37 -06:00
|
|
|
|
2021-01-17 14:36:38 -06:00
|
|
|
add_subdirectory(thirdparty)
|
|
|
|
|
2021-01-17 18:03:09 -06:00
|
|
|
add_subdirectory(shaders)
|
2021-01-26 16:42:28 -06:00
|
|
|
add_dependencies(couchlib shader_headers)
|
|
|
|
target_include_directories(couchlib
|
2021-01-18 18:25:47 -06:00
|
|
|
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/shaders/")
|
2021-01-17 18:03:09 -06:00
|
|
|
|
2021-03-16 13:33:49 -05:00
|
|
|
file(COPY LICENSE CORRESPONDINGSOURCE.txt DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
2021-01-15 14:20:25 -06:00
|
|
|
if(WIN32)
|
2021-01-17 14:36:38 -06:00
|
|
|
target_link_libraries(couch ssp)
|
2021-03-15 17:28:26 -05:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
2021-01-15 14:20:25 -06:00
|
|
|
endif(WIN32)
|
2021-01-20 17:37:56 -06:00
|
|
|
|
2021-04-05 14:48:31 -05:00
|
|
|
install(TARGETS couch couchlib couchlib_luascripting
|
|
|
|
RUNTIME DESTINATION bin
|
2021-04-05 14:50:12 -05:00
|
|
|
LIBRARY DESTINATION lib
|
2021-04-05 14:48:31 -05:00
|
|
|
ARCHIVE DESTINATION lib)
|
2021-01-27 16:05:46 -06:00
|
|
|
if (LUA_ENABLED)
|
2021-04-05 14:59:50 -05:00
|
|
|
install(TARGETS couchlua
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib)
|
2021-01-27 16:05:46 -06:00
|
|
|
endif ()
|