Files
cppsnek/CMakeLists.txt
rattatwinko add936694e initial
2025-05-08 17:53:21 +02:00

29 lines
845 B
CMake

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()