Fix compilation on Windows (MSVC) and move to a more maintainable way of handling of CMake variables being needed in the compilation process.
Differential Revision: https://phabricator.kde.org/D8412