2021-12-29 15:59:18 +01:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2021-04-03 19:14:31 +02:00
|
|
|
|
|
|
|
project(project-kyoku LANGUAGES CXX)
|
|
|
|
|
2021-09-14 16:51:06 +02:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2021-04-03 19:14:31 +02:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2021-07-27 20:18:37 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wpedantic -g")
|
2021-09-14 16:51:06 +02:00
|
|
|
|
2021-09-14 21:02:23 +02:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
|
2022-03-10 15:16:11 +01:00
|
|
|
set(CMAKE_RESOURCE_DIRECTORY ${CMAKE_SOURCE_DIR}/resources)
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2021-06-21 21:10:50 +02:00
|
|
|
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
|
|
|
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
|
|
|
set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
|
|
|
set(CMAKE_USE_PTHREADS_INIT 1)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
2021-04-03 19:14:31 +02:00
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
2022-02-23 23:45:43 +01:00
|
|
|
file(GLOB_RECURSE SOURCES "src/main.cpp" "include/*.h")
|
2021-07-27 20:18:37 +02:00
|
|
|
add_executable(project-kyoku ${SOURCES})
|
2021-04-04 22:43:12 +02:00
|
|
|
|
2021-09-14 21:02:23 +02:00
|
|
|
SET(CMAKE_INSTALL_PREFIX /)
|
2021-09-28 05:48:06 +02:00
|
|
|
# When new game modes appear, aggregate them into a ONE subdirectory
|
2021-12-29 15:59:18 +01:00
|
|
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/modes/classicmode/CMakeLists.txt")
|
|
|
|
add_subdirectory(src/modes/classicmode)
|
2021-09-14 21:02:23 +02:00
|
|
|
target_link_libraries(project-kyoku classicmode)
|
|
|
|
endif()
|
2021-12-29 15:59:18 +01:00
|
|
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/tools/CMakeLists.txt")
|
|
|
|
add_subdirectory(src/tools)
|
2021-09-14 21:02:23 +02:00
|
|
|
target_link_libraries(project-kyoku tools)
|
|
|
|
endif()
|
2021-12-29 15:59:18 +01:00
|
|
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/application/CMakeLists.txt")
|
|
|
|
add_subdirectory(src/application)
|
|
|
|
target_link_libraries(project-kyoku application)
|
|
|
|
endif()
|
|
|
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/impl/CMakeLists.txt")
|
|
|
|
add_subdirectory(src/impl)
|
|
|
|
target_link_libraries(project-kyoku impl)
|
2021-09-14 21:02:23 +02:00
|
|
|
endif()
|
2022-03-10 15:16:11 +01:00
|
|
|
|
|
|
|
file(COPY "${CMAKE_RESOURCE_DIRECTORY}" DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|