CMake VS Code Example

1 min read cmake, cpp, nix, vscode

Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/cmake-vscode-example.

  • example project using cmake
    • uses cmake Find*.cmake files in cmake/
  • uses Nix package manager for managing development dependencies
  • main.cpp contains examples/code that leverages SFML, SDL2, GLFW,OpenGL, and SQLite3 to demonstrate leveraging dependencies

Prerequisites

Build and Run

git clone
cd cmake-vscode-example

# install dependencies if needed and setup shell
nix-shell

mkdir build
cd build
cmake ..
make

# run
./example

Keep learning

Get new guides and courses by email

An occasional email when I publish a new guide, course or post. No spam, and you can unsubscribe any time.

Sent with Buttondown. I never share your address. Prefer a feed? Use the RSS feed.