Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.2, 6.8.0
-
None
Description
Attached you will find a sample project to demonstrate the issue.
In a cmake project, I use "qt_add_repc_replicas()" to generate a QRO replica class from a ".rep" template file.
In another header file (myclass.h), I reference the generated class with the aim to expose the generated class' enum "MyEnum" through QML_FOREIGN_NAMESPACE.
When building, QML tooling ("Automatic QML type registration for target ...") generates a warning:
Warning: myclass.h:: MyQroReplica is declared as foreign type, but cannot be found.
(Remember: when using Qt Creator, to see the warning in its "Compile Output" console, you have to set "
QT_ASSUME_STDERR_HAS_CONSOLE=1" for your "Build Environment")
When I put a copy of the generated replica header file into the source tree and add the file to the project, I do not receive the warning.
I even tried to generate the replica header file via a separate target and explicitly add the generated header file (from the build directory) to my qml module target. The warning is still there.
You may try the above mentioned setups by modifying the COMPILE_VARIANT variable in the attached projects CMakeLists.txt file.
# Original: replica header file is generated and added to target # Warning: yes set(COMPILE_VARIANT "Original") # Source: project uses a copy of the replica header file from the source tree # Warning: no # set(COMPILE_VARIANT "Source") # Source: project builds the replica header file in a separate target which is # then used and linked by the qml module target # Warning: yes # set(COMPILE_VARIANT "Build")