basic-game-framework/CMakeLists.txt

37 lines
729 B
CMake
Raw Permalink Normal View History

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)
2023-06-26 15:24:57 +00:00
file(
GLOB_RECURSE
2023-04-06 13:19:41 +00:00
SOURCE_C
"${CMAKE_SOURCE_DIR}/src/**.c")
2023-06-26 15:24:57 +00:00
file(
GLOB_RECURSE
2023-04-06 13:19:41 +00:00
SOURCE_CPP
"${CMAKE_SOURCE_DIR}/src/**.c*")
2023-06-26 15:24:57 +00:00
add_executable(
${PROJECT}
2023-04-06 13:19:41 +00:00
${SOURCE_C}
${SOURCE_CPP})
2023-06-27 07:30:00 +00:00
target_link_libraries(${PROJECT} SDL2 SDL2_image SDL2_ttf m)
2023-04-06 13:19:41 +00:00
target_include_directories(${PROJECT} PRIVATE "${CMAKE_SOURCE_DIR}/include/" "${CMAKE_SOURCE_DIR}/src/corelib" "${CMAKE_SOURCE_DIR}/src/ui")