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