Skip to content

Instantly share code, notes, and snippets.

@MarioLiebisch
Last active August 20, 2018 08:46
Show Gist options
  • Save MarioLiebisch/0a38370ed1d3d3009277 to your computer and use it in GitHub Desktop.
Save MarioLiebisch/0a38370ed1d3d3009277 to your computer and use it in GitHub Desktop.
A minimal CMakeLists.txt file for a SFML project
cmake_minimum_required(VERSION 3.10)
project(my_sfml_project)
# Find SFML and the given components
find_package(SFML 2.5 COMPONENTS graphics window system)
# Add the SFML include dir
include_directories(${SFML_INCLUDE_DIR})
# Create the executable file
add_executable(my_sfml_app main.cpp)
# As an alternative, this could also create a library:
# add_library(my_sfml_lib library.cpp)
# Link SFML and its dependencies
target_link_libraries(my_sfml_app sfml-graphics sfml-window sfml-system)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment