Hi, I’m trying to start porting my .pro/.pri files to cmake and I’m stumbling on the following error:
error: redefinition of ‘unit' const QQmlPrivate::CachedQmlUnit unit The file shared_qmlcache_loader.cpp has a the following content: namespace QmlCacheGeneratedCode { namespace _shared_resources_qml_Browser_qml { extern const unsigned char qmlData[]; extern const QQmlPrivate::AOTCompiledFunction aotBuiltFunctions[]; const QQmlPrivate::CachedQmlUnit unit = { reinterpret_cast<const QV4::CompiledData::Unit*>(&qmlData), &aotBuiltFunctions[0], nullptr }; } namespace _shared_resources_qml_BrowserBank_qml { extern const unsigned char qmlData[]; extern const QQmlPrivate::AOTCompiledFunction aotBuiltFunctions[]; const QQmlPrivate::CachedQmlUnit unit = { reinterpret_cast<const QV4::CompiledData::Unit*>(&qmlData), &aotBuiltFunctions[0], nullptr }; } unit is always being used as a variable for each qml component. In my CMakeLists.txt I have the following include: include(qml.cmake) list(APPEND QML_FILES resources/qml/Browser.qml resources/qml/BrowserBank.qml resources/qml/BrowserButton.qml … qt_add_qml_module(shared URI shared VERSION 1.0 QML_FILES ${QML_FILES} SOURCES ${SOURCE_FILES} ) Not specifying qml source, it compiles correctly. _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest