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