Clone the repo recursively:
git clone --recursive https://github.com/ericnantel/cmake_examples cmake_examples
- git
- conan
- cmake
- ninja (recommended)
- a C++ compiler (gcc, clang or msvc)
- python3
- bear (optional)
Some examples might require installing addtionnal packages on your system. Although most dependencies will use conan, there are still some packages that you will either need to install manually or add as a subdirectory (git submodule update).
In Episode 03 you will need to install:
- doxygen
In Episode 04 you previously needed to install:
- googletest But I moved the dependency to conanfile.txt
In Episode 06 you will need to install:
- libgtk-3-dev (apt - Debian/Ubuntu)
- conan profile detect --force
- conan install
- conan install --build=gtest/1.18.0
- conan list
- conan remove gtest
- nvim ~/.conan2/profiles/default
- cmake --list-presets
- cmake --workflow --list-presets
- cmake --preset default
- cmake --fresh --preset default
- cmake --build --preset default
- ctest --preset default
- cmake --workflow --preset default
- cmake --workflow --fresh --preset default
Ex toml_parser (Episode 01):
- ./build/toml_parser
Ex test_simple (Episode 04):
- ./build/GoogleTests
- Episode 01 - C++ TOML Integration
- Episode 02 - C++ Unity Plugin For Games !
- Episode 03 - C++ Doxygen Docs
- Episode 04 - C++ Unit Testing (CTest + GoogleTest)
- Episode 05 - C++ Package Manager (Conan)
- Episode 06 - C++ Gtk3 Simple Application
Usually Makefile and Ninja generators can export compile commands for Clangd (lsp), but if using Visual Studio or perhaps GCC then you may need to use Bear to intercept build commands and produce those compile commands. Also it produces a cleaner file imo. To use Bear, first you must install it (ideally with a package manager) and then you can do the following to configure and build a CMake project:
- bear -- cmake --list-presets
- bear -- cmake --fresh --preset default
- bear -- cmake --build --preset default
You can also use a workflow preset with bear:
- bear -- cmake --workflow --fresh --preset default
It should generate a compile_commands.json in the CMake root path.
Is subject to change at anytime. See Roadmap here
I am using Emacs to write ROADMAP.org. However GitHub doesn't render org files properly (especially tasks). So I am using pandoc to convert org to md files, such as ROADMAP.org.
Here is the command I use to convert .org to .md:
- pandoc --from=org --to=gfm ROADMAP.org -o ROADMAP.md
Eric Nantel (Canada) Senior Level
Make sure to follow me 😸 ⭐ Help this repository by giving it a star . It really helps me .