My Project uses Qt and hence I have set AUTORCC as ON.
Because, AUTORCC is ON, the qrc files in the target sources would be picked and rcc executable would be invoked, resulting in the generation of qrc_qml_CMAKE_.cpp file in the intermediate directory. I would like to set some compile_options for this generated file but have not been able to do so.
What would be the right way to get the path of this generated file and then set the compile_options for this file ?
[760/762] Building CXX object CMakeFiles\TWKshetrapalQt.dir\Debug\TWKshetrapalQt_autogen\WHDP5WPTFN\qrc_qml.cpp.obj
In file included from D:\TW\Builds\TWInt\Windows-x64\TWKshetrapalQt_autogen\WHDP5WPTFN\qrc_qml.cpp:3:
D:\TW\Builds\TWInt\Windows-x64\TWKshetrapalQt_autogen\include_Debug\WHDP5WPTFN/qrc_qml_CMAKE_.cpp(133,6): warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
} dummy;
^
D:\TW\Builds\TWInt\Windows-x64\TWKshetrapalQt_autogen\include_Debug\WHDP5WPTFN/qrc_qml_CMAKE_.cpp(133,6): warning: declaration requires a global destructor [-Wglobal-constructors]
2 warnings generated.
TWInt is where all the intermediate files go like CMakeFiles, *_autogen directories, *.ninja files etc.
Just to add to the above and to state the problem better.
the qrc_qml.cpp and qrc_qml_CMAKE_.cpp gets generated during ‘build-time’. and AUTORCC is ON for the target, these files gets generated when RCC kicks in and the generated files are compiled.
Is there a way to set the compile-options for these generated files that were not part of the target sources during cmake cache generation but came into existence later during build.
Yes, sorry, it should have been -Wno-exit-time-destructors.
However the problem persists.
I believe the issue is (as I mentioned in the last comment above) - The source file on which the compile-options need to be set is a generated file that gets created during build time. In such cases, how can we set the compile-options ? Is some kind of generated-expression available for such scenarios ?