Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95834

Improve error message when feature value is suddenly flipped in a CMake project

XMLWordPrintable

    • 15117f84bb (qt/qtbase/dev) 048e783b18 (qt/qtbase/6.3) c711bf3158 (qt/qtbase/6.4) 048e783b18 (qt/tqtc-qtbase/6.3) c711bf3158 (qt/tqtc-qtbase/6.4) 5e311011ff (qt/tqtc-qtbase/6.2)

      If one builds qtbase with the vulkan feature disabled, configures an example against that Qt, then rebuilds the same Qt with the vulkan feature enabled and reconfigures the example project without removing the CMakeCache.txt file, CMake will show the following error:

      lib/cmake/Qt6/QtFeature.cmake:1086: error: Feature vulkan is already defined to be "OFF" and should now be set to "ON" when importing features from Qt6::Gui. lib/cmake/Qt6Gui/Qt6GuiConfig.cmake:118 (qt_make_features_available) lib/cmake/Qt6/Qt6Config.cmake:127 (find_package) CMakeLists.txt:19 (find_package)
      

      The error message is confusing, and does not tell the project builder what they can do to avoid it.

      We should either improve the message to tell what the user should do (remove CMakeCache.txt) or reconsider if we need the check in the first place.

      The error message was already updated once, but it's still not clear to the builder how to avoid the error. https://codereview.qt-project.org/c/qt/qtbase/+/333539

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            alexandru.croitor Alexandru Croitor
            alexandru.croitor Alexandru Croitor
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes