This is simple project using CMake for multidirectory C++ project with SDL and GoogleTest.
- Install Mingw-w64.
- Install cmake.
- Download SDL development library.
- Rename
.vscode/c_cpp_properties.json.example
to.vscode/c_cpp_properties.json
- Replace
[PATH_TO_SDL]
in.vscode/c_cpp_properties.json
with path where you keep SDL source. - Rename
CMakeLists.txt.example
toCMakeLists.txt
- Replace
[PATH_TO_SDL]
inCMakeLists.txt
with path where you keep SDL source. - Set
prefix
,SDL2_PREFIX
,SDL2_EXEC_PREFIX
insdl2-config.cmake
in[PATH_TO_SDL]/lib/cmake/SDL2
directory to[PATH_TO_SDL]
. - Copy SDL2.dll to src directory.
- From root directory run command
cmake -G "MinGW Makefiles" .
- Run command
mingw32-make.exe
- Run executable
./src/main.exe
- For tests run executable
./tests/example.exe
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