Exclude source from build
-
Hi Folks,
My use case is the following:
I have some classes (source and header) that implement Windows, Linux or MAC dependent part.
How should I edit my .pro file for exclude the appropriate classes from the build, BUT they stay there in the project side bar for reading or even editing them?
Can I do this via the .pro file?Regards,
Norbert -
@moravas
i can only think of something like this:win32 { SOURCES += win.cpp } else { OTHER_FILES += win.cpp }
-
I scope them as @raven-worx shows for the different platforms, but I don't use
OTHER_FILES
, they are visible in my Creator (4.2) even if not built. -
@kshegunov
that was what he requested ... as i understood it?
If i am wrong, remove the else part. -
Yes, I know, I meant that
OTHER_FILES += win.cpp
shouldn't be needed. At least I don't need it for the files to show in Creator. For example I have:macx { SOURCES += \ $$PWD/qdaemoncontroller_osx.cpp \ $$PWD/qdaemon_osx.cpp } else: unix { SOURCES += \ $$PWD/qdaemoncontroller_linux.cpp \ $$PWD/qdaemon_linux.cpp }
and I see all of them in the sidebar regardless of the platform.
-
@kshegunov
ah ok, didn't know that. -
This might've been a change between Creator versions, that's why I'm raising it as a point (and providing my IDE's version). I think that on older versions this wasn't the case.