Skip to content

Add CMake configuration files for the exercises, master branch (2020.10.09.)

After some pondering I thought it could be beneficial to the example code if it could be compiled natively on as many platforms as possible. To do this, I opted to add CMakeLists.txt files to all of the example projects.

This should have a positive effect on not just the macOS and Windows builds, but even the Linux ones. Since for instance for the Python example the CMake configuration allows for a lot more robust build. (Not having to hardcode where Python is supposed to come from.)

The one controversial part of this is how I opted to implement the examples that build shared libraries, and can technically run on Windows. (The Python example I didn't even bother with...) I didn't want to fall back to static libraries with the build, so I had to update the C++ code to explicitly export the symbols of the shared library. This way the code can be built into DLLs on Windows successfully. However this also means that the existing Makefile-s of those projects don't work anymore. 😦 (For most projects the CMakeLists.txt file can work in addition to the existing Makefile.)

And just to show some pretty screenshots. 😛

Screen_Shot_2020-10-09_at_11.50.57_AM

Screenshot_2020-10-09_095326

Pinging @sponce and @graemes.

Merge request reports