2023-04-06 13:19:41 +00:00
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
|
2023-04-11 06:08:38 +00:00
|
|
|
set(PROJECT "sim-game")
|
2023-04-06 13:19:41 +00:00
|
|
|
|
|
|
|
project(${PROJECT})
|
|
|
|
|
|
|
|
set(${PROJECT} LANGUAGES C CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")
|
|
|
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS)
|
|
|
|
|
2023-04-20 22:26:03 +00:00
|
|
|
set(CMAKE_C_FLAGS "-lm")
|
|
|
|
|
2023-04-06 13:19:41 +00:00
|
|
|
find_package(SDL2)
|
|
|
|
find_package(SDL2_image)
|
|
|
|
find_package(SDL2_ttf)
|
|
|
|
|
|
|
|
file(GLOB_RECURSE
|
|
|
|
SOURCE_C
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/**.c")
|
|
|
|
file(GLOB_RECURSE
|
|
|
|
SOURCE_CPP
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/**.c*")
|
|
|
|
|
|
|
|
add_executable(${PROJECT}
|
|
|
|
${SOURCE_C}
|
|
|
|
${SOURCE_CPP})
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT} SDL2 SDL2_image SDL2_ttf)
|
|
|
|
|
2023-05-05 21:19:02 +00:00
|
|
|
target_include_directories(${PROJECT} PRIVATE "${CMAKE_SOURCE_DIR}/include/" "${CMAKE_SOURCE_DIR}/src/corelib" "${CMAKE_SOURCE_DIR}/src/ui")
|