This commit is contained in:
rattatwinko
2025-05-08 17:53:21 +02:00
commit add936694e
9 changed files with 610 additions and 0 deletions

29
CMakeLists.txt Normal file
View File

@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.15)
project(cppsnek)
set(CMAKE_CXX_STANDARD 17)
find_package(SFML 2.5 COMPONENTS graphics window system REQUIRED)
add_executable(cppsnek main.cpp)
target_link_libraries(cppsnek
PRIVATE
sfml-graphics
sfml-window
sfml-system
)
if(WIN32)
add_custom_command(TARGET snake_game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${SFML_DIR}/../bin/sfml-graphics-2.dll"
"${CMAKE_BINARY_DIR}/sfml-graphics-2.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${SFML_DIR}/../bin/sfml-window-2.dll"
"${CMAKE_BINARY_DIR}/sfml-window-2.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${SFML_DIR}/../bin/sfml-system-2.dll"
"${CMAKE_BINARY_DIR}/sfml-system-2.dll"
)
endif()