I have for some of my classes different implementations per OS.
My source structure is like this:
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
What techniques can you recommend to realize this in a professional way?
This is fairly easy in CMake.
Just have your CMakeLists.txt file check the platform, and add in the appropriate files or include the appropriate subdirectory as needed.
The basic syntax is:
IF(WIN32)
# Do windows specific includes
ELSEIF(UNIX)
# Do linux specific includes
ENDIF(WIN32)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With