I have for some of my classes different implementations per OS.
My source structure is like this:
- include/AExample.h
- include/windows/WindowsExample.h
- include/linux/LinuxExample.h
- src/AExample.cpp
- src/windows/WindowsExample.cpp
- src/linux/LinuxExample.cpp
the A* classes are the interfaces for the specific implementations
My current buildsystem is cmake - but at the moment its only capable of building the linux version.
In a windows build i only need to include the windows/* file and on linux only the linux/* files
I need to
- include only the files that are relevant for my current build
- choose the right implementation when i need an instance of AExample
What techniques can you recommend to realize this in a professional way?