Preconfigured CMake + vcpkg project for FFU as a base of other projects.
The app source is a copy of
example_glfw_opengl3
with some modifications with a goal to hide a backend initialization spaghetti
code. The hidden code located in imgui_bootstrap.hpp
header file.
The next set of backend libs is used for ImGUI:
- opengl;
- glfw3;
- glad;
- glm.
All of them are fetched by vcpkg
. Only ImGUI
is fetched from GitHub
repo with FetchContent
tool. See
deps/imgui.cmake
.
For Windows "Visual Studio 15 2017" is used. For Linux GCC with C++17 support is used. The compiler must be installed on your system before the configuring. Ninja is required for the Linux build too.
If you want to build a release version change CMAKE_BUILD_TYPE
in
CMakePresets.json
file.
You have just to run a preconfigured CMake script to init vcpkg, configure and build all.
cmake -P build_all.cmake
or separately
cmake -D CONFIGURE=YES -P build_all.cmake
cmake -D BUILD=YES -P build_all.cmake
Go to the root folder and clone vcpkg
.
git clone https://github.com/microsoft/vcpkg.git
Then configure CMake with a preset accoring to your OS.
cmake --preset=windows .
# or
cmake --preset=linux .
Build the executable:
cmake --build build
After the building, the executable should appear somewhere in build
folder.
On Windows it should be in Debug
subfolder.
The project's been preconfigured for VS Code
IDE. See .vscode
folder files. Just
- open the project in VS Code,
- install C++ and CMake extentions,
- rename
settings.template.json
tosettings.json
, - select one of CMake, presets,
- press the build button.
After that, you can select launch configuration according to your platform and
start debugging. Pay attention to linux.env
file if you are on the Linux
platform: DISPLAY
variable must be selected correctly or deleted from there.