Skip to content

Fix cmake builds on linux#1

Open
enaix wants to merge 5 commits intowangwenx190:mainfrom
enaix:main
Open

Fix cmake builds on linux#1
enaix wants to merge 5 commits intowangwenx190:mainfrom
enaix:main

Conversation

@enaix
Copy link

@enaix enaix commented Jan 13, 2023

There were some errors in cmakelists and linux wallpaper code that prevented it from compiling

Copy link
Owner

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@enaix
Copy link
Author

enaix commented Jan 16, 2023

I am currently trying to fix the issue with the qmlimportscanner: in demo/CMakeLists.txt

  qt_add_qml_module(Demo
      URI Demo
      VERSION 1.0
      IMPORTS
          QtQml
          QtQuick
          QtQuick.Controls.Basic
          org.wangwenx190.QtAcrylicMaterial
      QML_FILES MainWindow.qml
      IMPORT_PATH ${PROJECT_BINARY_DIR}/imports
      ENABLE_TYPE_COMPILER # <---
  ) 

qmlimportscanner reads ENABLE_TYPE_COMPILER as an import file. Might be an issue with indentation. QT Creator didn't print this warning for some reason, so I was confused and tried to fix a different issue.

Error copying file (if different) from "/home/fitz/src/smartwheel-core/opengl/qtacrylicmaterial/demo/ENABLE_TYPE_COMPILER" to "/home/fitz/src/smartwheel-core/opengl/qtacrylicmaterial/demo/Demo/ENABLE_TYPE_COMPILER".
CMake Warning at /usr/lib64/cmake/Qt6Qml/Qt6QmlMacros.cmake:1982 (message):
  Only .qml, .js or .mjs files should be added with QML_FILES.  The following
  files should be added with RESOURCES instead:

    ENABLE_TYPE_COMPILER
Call Stack (most recent call first):
  /usr/lib64/cmake/Qt6Qml/Qt6QmlMacros.cmake:575 (qt6_target_qml_sources)
  /usr/lib64/cmake/Qt6Qml/Qt6QmlMacros.cmake:626 (qt6_add_qml_module)
  demo/CMakeLists.txt:41 (qt_add_qml_module)

During the compilation, it throws qmlimportscanner: No such file or directory: "ENABLE_TYPE_COMPILER" error

@enaix
Copy link
Author

enaix commented Jan 16, 2023

I guess that I have found the source of an error: qt6-qtdeclarative-devel-6.3.1-2.fc36.x86_64 Fedora package provides /usr/lib64/cmake/Qt6Qml/Qt6QmlMacros.cmake, which has an error: it misses the ENABLE_TYPE_COMPILER option. In qtdeclarative source code Qt6QmlMacros.cmake the option is present.

EDIT: it is fixed in the most recent package version (rawhide branch)

@enaix
Copy link
Author

enaix commented Jan 16, 2023

Now the only remaining issue is that custom components are not found by the compiler in demo/MainWindow.qml: DesktopWallpaper was not found. Did you add all import paths?

Import statement does not throw any error, which is weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants