Skip to content

build-cpp/SDL2-example

Repository files navigation

SDL2 Example

Simple template to get started with SDL2.

This template uses cmkr together with vcpkg for frictionless cross platform dependency management with CMake.

Building (IDE)

Clone this repository and open it in your favorite IDE with CMake support (Visual Studio, CLion, Qt Creator). Everything should work out of the box.

Building (command line)

cmake -B build
cmake --build build

cmake.toml

Under the hood cmkr generates the CMakeLists.txt required to build this project from the cmake.toml file:

# Reference: https://build-cpp.github.io/cmkr/cmake-toml
[project]
name = "cmkr-sdl"

[vcpkg]
version = "2023.01.09"
packages = ["sdl2"]

[find-package.SDL2]

[target.cmkr-sdl]
type = "executable"
sources = ["src/cmkr-sdl/main.cpp"]
compile-features = ["cxx_std_11"]
link-libraries = ["SDL2::SDL2", "SDL2::SDL2main"]

About

Simple example of using SDL2 via vcpkg

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published