added CMake project

pull/1/head
Sara 2023-04-06 15:19:41 +02:00
parent a76a12c772
commit eba8630283
2 changed files with 53 additions and 0 deletions

31
CMakeLists.txt Normal file
View File

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.17)
set(PROJECT "tabletop")
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)
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)
target_include_directories(${PROJECT} PRIVATE "${CMAKE_SOURCE_DIR}/include/" "${CMAKE_SOURCE_DIR}/src/sge/")

22
compile_commands.json Normal file
View File

@ -0,0 +1,22 @@
[
{
"directory": "/home/sara/Documents/c-projects/tabletop/release",
"command": "/usr/bin/cc -I/home/sara/Documents/c-projects/tabletop/include -I/home/sara/Documents/c-projects/tabletop/src/sge -O3 -DNDEBUG -o CMakeFiles/tabletop.dir/src/assets.c.o -c /home/sara/Documents/c-projects/tabletop/src/assets.c",
"file": "/home/sara/Documents/c-projects/tabletop/src/assets.c"
},
{
"directory": "/home/sara/Documents/c-projects/tabletop/release",
"command": "/usr/bin/cc -I/home/sara/Documents/c-projects/tabletop/include -I/home/sara/Documents/c-projects/tabletop/src/sge -O3 -DNDEBUG -o CMakeFiles/tabletop.dir/src/engine.c.o -c /home/sara/Documents/c-projects/tabletop/src/engine.c",
"file": "/home/sara/Documents/c-projects/tabletop/src/engine.c"
},
{
"directory": "/home/sara/Documents/c-projects/tabletop/release",
"command": "/usr/bin/cc -I/home/sara/Documents/c-projects/tabletop/include -I/home/sara/Documents/c-projects/tabletop/src/sge -O3 -DNDEBUG -o CMakeFiles/tabletop.dir/src/game.c.o -c /home/sara/Documents/c-projects/tabletop/src/game.c",
"file": "/home/sara/Documents/c-projects/tabletop/src/game.c"
},
{
"directory": "/home/sara/Documents/c-projects/tabletop/release",
"command": "/usr/bin/cc -I/home/sara/Documents/c-projects/tabletop/include -I/home/sara/Documents/c-projects/tabletop/src/sge -O3 -DNDEBUG -o CMakeFiles/tabletop.dir/src/render.c.o -c /home/sara/Documents/c-projects/tabletop/src/render.c",
"file": "/home/sara/Documents/c-projects/tabletop/src/render.c"
}
]