Hello,
I am planning to write a C++ application that is using Qt5. As ar as I understood: with using qmake and afterwards make, it should be fairly portable across *BSD and Linux systems. (eventually, falling back to gmake).
Now, I want to do some tasks that differ across the *BSD and Linux systems and I thought about adding one class for each operating system (i.e. I inherit from a base class that encapsulates platform independent code but then, when something is specific on a particular system, I create a separate class for that system).
My question is: how should one do that? What is the simplest way to achieve cross platform in-dependency with C++/Qt5?
Furthermore, how would I control which linker flags (in particular which additional libraries) should be used?
The only thing that comes to my mind are #ifdef but perhaps, there are smarter ways than that?
Maybe there is some Qt library wrapper that does handle all that for me (not sure though). Any hints, case studies or tip's?
Thanks!
I am planning to write a C++ application that is using Qt5. As ar as I understood: with using qmake and afterwards make, it should be fairly portable across *BSD and Linux systems. (eventually, falling back to gmake).
Now, I want to do some tasks that differ across the *BSD and Linux systems and I thought about adding one class for each operating system (i.e. I inherit from a base class that encapsulates platform independent code but then, when something is specific on a particular system, I create a separate class for that system).
My question is: how should one do that? What is the simplest way to achieve cross platform in-dependency with C++/Qt5?
Furthermore, how would I control which linker flags (in particular which additional libraries) should be used?
The only thing that comes to my mind are #ifdef but perhaps, there are smarter ways than that?
Maybe there is some Qt library wrapper that does handle all that for me (not sure though). Any hints, case studies or tip's?
Thanks!