fix building in MacOS after upgrade to C++17
- the usage of
std::variant
requires a minimum deployment target of MacOS 10.14 - for correct compiler flags we must use
CMAKE_CXX_STANDARD
and related variables - for C++17 support in the above variables, we need at least CMake 3.8
Note: This fix is mostly to get things back to working but in an upcoming CMake refactoring project, I'm planning to rework/cleanup/modernise most of this anyway.
This was tested on Linux, Windows, MacOS 10.14 (Intel) and MacOS 11.6 (Apple Silicon).