Building examples on linux
Examples are not build under Linux unless
-DINSTALL_EXAMPLES=ON is also set when configuring.
I would expect them to be build with that:
cmake -S . -B build -DBUILD_EXAMPLES=ON or even
cmake -S . -B build (since
BUILD_EXAMPLES is on by default).
They are only build when using
cmake -S . -B build -DBUILD_EXAMPLES=ON -DINSTALL_EXAMPLES=ON
Reading CMakeLists.txt:488 ff I can see the issue and I assume there have been reasons to treat the windows build differently - but that's inconvenient and reasons are not clear/documented.
Updated by Roel Standaert 3 months ago
On non-Windows the examples are indeed not part of the
You can actually build all examples by running
make in the
examples subdirectory of the build folder, or if you're using Ninja you can use the
I'm not sure why we're building all of the examples by default on Windows, maybe that's because of issues with CMake at the time. I would not build them by default on all platforms.