Precompiled headers with CMake in Qt 6. How?
-
Hi,
See this Qt blog as a starting point.
-
So hard using an internet search engine?
https://cmake.org/cmake/help/latest/command/target_precompile_headers.html -
@Christian-Ehrlicher I've been asking in case of using Qt 6 with CMake and documentation about it in Qt. Not about just C++ project with CMake. I know perfectly about CMake functionality.
-
@bogong said in Precompiled headers with CMake in Qt 6. How?:
I've been asking in case of using Qt 6 with CMake and documentation about it in Qt.
What should be different when using Qt or plain c++ here?
-
@Christian-Ehrlicher Have you really read the question? If you have nothing to reply why are you righting it? The question is about something special in Qt 6.0. everything is in my question.
-
@bogong said in Precompiled headers with CMake in Qt 6. How?:
The question is about something special in Qt 6.0. everything is in my question.
You ask how to use precompile headers with Qt6 & cmake. I told you to use target_precompile_headers(). So what's wrong with this answer? What else do you want to know (but do not ask for)?
-
@Christian-Ehrlicher No, he is absolutely right, you are not contributing anything here apart from Google users being annoyed about reading this argument. Lifetime champion or not, your are not being constructive. And your disrespectful tone makes it even worse.
To be explicit here: Interesting would be to see how we can a wellformed list of Qt header names that can be used to pass to the CMake function. (And please don't answer know how to generate the list manually, this is trivial, too, but are there shortcuts? Can this be automatised in <1min? These are the important questions)
-
@IceMichael said in Precompiled headers with CMake in Qt 6. How?:
Interesting would be to see how we can a wellformed list of Qt header names that can be used to pass to the CMake function
No since CMake don't know what headers you're using / you want to use. Even when you link against Qt::Widgets adding the <QtWidgets> header to the precompiled target may be wrong. Adding some important headers manually shouldn't be that big problem.