An SDL2 CMake Template designed to streamline the development of SDL2-based projects. This repository provides a starting point for building C++ applications with SDL2 using CMake.
- CMake Integration: Simplifies the build process for SDL2 projects.
- Cross-Platform: Works seamlessly on Windows, macOS, and Linux.
- Minimal Configuration: Pre-configured to get started quickly.
- Modular Design: Easily extendable for larger SDL2 projects.
- CMake (version 3.15 or higher)
- SDL2 Library
- A C++ Compiler (e.g., GCC, Clang, MSVC)
-
Clone the repository:
git clone https://github.com/tyoungjr/SDLCMakeTemplate.git
-
Navigate to the project directory:
cd SDLCMakeTemplate
-
Create a build directory and configure the project:
mkdir build && cd build cmake ..
-
Build the project:
cmake --build .
-
Run the generated executable:
./YourExecutable
CMakeLists.txt
: Main CMake configuration file.src/
: Source files for your SDL2 project.include/
: Header files for your project.assets/
: Resources like images, sounds, etc. (if applicable).build/
: Directory for generated build files (not included in the repository).
Contributions are welcome! Please feel free to submit issues, fork the repository, and create pull requests.
This project is licensed under the MIT License.