/SDL_untitled_project

C++ multidirectory game project using CMake, SDL, Google Test and Github Workflows for automated tests run. Contains tasks and configuration for development in Visual Studio Code.

Primary LanguageC++

Description

This is simple project using CMake for multidirectory C++ project with SDL and GoogleTest.

Prerequisites

On Windows:

  1. Install Mingw-w64.
  2. Install cmake.
  3. Download SDL development library.

How to run

On Windows:

Pre-steps

  1. Rename .vscode/c_cpp_properties.json.example to .vscode/c_cpp_properties.json
  2. Replace [PATH_TO_SDL] in .vscode/c_cpp_properties.json with path where you keep SDL source.
  3. Rename CMakeLists.txt.example to CMakeLists.txt
  4. Replace [PATH_TO_SDL] in CMakeLists.txt with path where you keep SDL source.
  5. Set prefix, SDL2_PREFIX, SDL2_EXEC_PREFIX in sdl2-config.cmake in [PATH_TO_SDL]/lib/cmake/SDL2 directory to [PATH_TO_SDL].
  6. Copy SDL2.dll to src directory.

From terminal:

  1. From root directory run command cmake -G "MinGW Makefiles" .
  2. Run command mingw32-make.exe
  3. Run executable ./src/main.exe
  4. For tests run executable ./tests/example.exe

From VSCode:

To build project from VSCode go to Terminal -> Run Build Task

To debug project in VSCode go to Run -> Start Debugging or Run -> Start without Debugging