Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-33489

Importing a qt cmake project build into Creator creates a Qt Kit with the default Creator cmake version, rather than trying to detect the one that was used for the project before importing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • Qt Creator 18.0.0
    • None
    • macOS

      Steps to reproduce.
      1) Ensure homebrew cmake is the one in PATH in the terminal
      2) Configure analogclock example on the command line with a prebuilt Qt using qt-cmake
      e.g.

      cd ~/my_analog_build_dir
      ~/Dev/qt/official/6.9.2/macos/bin/qt-cmake ~/Dev/qt/official/Examples/Qt-6.9.2/widgets/widgets/analogclock
      

      3) Confirm the cmake version used by checking the CMakeCache.txt in the build dir

      CMAKE_COMMAND:INTERNAL=/opt/homebrew/bin/cmake
      

      4) Install a standalone cmake from https://github.com/Kitware/CMake/releases/tag/v4.1.1 , by unpacking it somewhere, and adding it to Creator in Settings -> CMake -> Tools -> Add, and making sure to "Make Default" it.

      5) Open $HOME/Dev/qt/official/Examples/Qt-6.9.2/widgets/widgets/analogclock/CMakeLists.txt as a project, paste the build dir "HOME/my_analog_build_dir" into "Import Build From", press Import and then Configure Project.

      6) Observe that it's running the default Creator cmake version on the the build dir, rather than trying to extract the previous cmake version from CMAKE_COMMAND in CMakeCache.txt

      In my case I see

      Running /Users/alex/.local/share/mise/installs/cmake/4.1.0/CMake.app/Contents/bin/cmake -S /Users/alex/Dev/qt/official/Examples/Qt-6.9.2/widgets/widgets/analogclock -B /Users/alex/Dev/qt/builds/dev-mac-super/analog in /Users/alex/Dev/qt/builds/dev-mac-super/analog.
      

      This can lead to full rebuilds of the project, due to different CMake versions placing command line options in a different order on the command line, among other possible issues.

      It would be good for Creator to detect the cmake version from CMakeCache.txt, and use it instead.

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

            cadam Cristian Adam
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes