Qt creator can not parse cmake version after update from Qt 6.5.3 to Qt 6.7.2
-
this issue has stocked to me for 2 days, I really want to fix this.
Backgound
I recently update Qt 6.5.3 to Qt 6.7.2 for Windows 10, there is a issue "error: The kit needs to define a CMake tool to parse this project." when I opened a project. Then I checked Edit>Preference>Kits, I see a warning says Cmake is unconfigured.
and I check Cmake Setting, It says cmake version is not parseable.
And there is no Cmake generator
What have I done
I tried to remove all components of Qt and install all over again using Qt maintenance tool, but nothing changes, I tried to install Qt creator Community 13.0.2 and Qt Creator 14.0.0-beta2 Community but nothing changes, I tried to Install Qt 6.5.3, Qt 6.6.3 and Qt 6.7.2 but nothing changes.
I checked my enviromment path, I think everything is fine.
Qt672 meas kits path for Qt 6.7.2, I alse have QT663 and qt653 for each specific version of Qt kit.
What is bizzared
I use Qt design studio for fun and I checked its preference setting, I found Qt design studio can parse Cmake version!!!!
And this show what I installed
This is so frustrating and sucks! I search every related web page, asked ChatGPT mang questions, But I really can not find a solution.
Any suggestion will be appreciated, Please help me!
-
I would suggest starting the Maintainance Tool and reinstall the CMake version (first remove, restart, and add again).
Qt Creator gets the Qt SDK CMake information from
C:\Qt\Tools\sdktool\share\qtcreator\QtProject\qtcreator\cmaketools.xml
. Have a look in the xml file and check for sanity.Here is my version:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorCmaketools> <!-- Written by sdktool , 2024-07-12T09:30:39. --> <qtcreator> <data> <variable>CMakeTools.0</variable> <valuemap type="QVariantMap"> <value type="bool" key="Autodetect">true</value> <value type="QString" key="Binary">C:/Qt\Tools\CMake_64\bin\cmake.exe</value> <value type="QString" key="DisplayName">CMake 3.29.3 (Qt)</value> <value type="QString" key="Id">qt.tools.cmake</value> </valuemap> </data> <data> <variable>CMakeTools.Count</variable> <value type="int">1</value> </data> <data> <variable>Version</variable> <value type="int">1</value> </data> </qtcreator>
Qt Creator uses
sdktool/share/qtcreator/QtProject/qtcreator/cmaketools.xml
as a template for it's own settings.Go to
"%appdata%\QtProject\qtcreator\cmaketools.xml"
and again check for sanity.My version looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorCMakeTools> <!-- Written by QtCreator 13.0.2, 2024-07-12T09:40:59. --> <qtcreator> <data> <variable>CMakeTools.0</variable> <valuemap type="QVariantMap"> <value type="bool" key="AutoCreateBuildDirectory">false</value> <value type="bool" key="AutoDetected">true</value> <value type="bool" key="AutoRun">true</value> <value type="QString" key="Binary">C:/Qt/Tools/CMake_64/bin/cmake.exe</value> <value type="QString" key="DetectionSource"></value> <value type="QString" key="DisplayName">CMake 3.29.3 (Qt)</value> <value type="QString" key="Id">qt.tools.cmake</value> <value type="QString" key="QchFile">C:/Qt/Tools/CMake_64/doc/cmake/CMake.qch</value> </valuemap> </data> <data> <variable>CMakeTools.1</variable> <valuemap type="QVariantMap"> <value type="bool" key="AutoCreateBuildDirectory">false</value> <value type="bool" key="AutoDetected">true</value> <value type="bool" key="AutoRun">true</value> <value type="QString" key="Binary">C:/Program Files/CMake/bin/cmake.exe</value> <value type="QString" key="DetectionSource"></value> <value type="QString" key="DisplayName">System CMake at C:\Program Files\CMake\bin\cmake.exe</value> <value type="QString" key="Id">{0656c167-a015-475f-b76d-ea16048564a9}</value> <value type="QString" key="QchFile">C:/Program Files/CMake/doc/cmake/CMake.qch</value> </valuemap> </data> <data> <variable>CMakeTools.Count</variable> <value type="int">2</value> </data> <data> <variable>CMakeTools.Default</variable> <value type="QString">{0656c167-a015-475f-b76d-ea16048564a9}</value> </data> <data> <variable>Version</variable> <value type="int">1</value> </data> </qtcreator>
-
Here is the Qt Creator's function that checks for validity:
bool CMakeTool::isValid() const { if (!m_id.isValid() || !m_introspection) return false; if (!m_introspection->m_didAttemptToRun) readInformation(); return m_introspection->m_haveCapabilitites && !m_introspection->m_fileApis.isEmpty(); }
It can fail if
<value type="QString" key="Id">qt.tools.cmake</value>
is empty,Id
that is.Or if
C:\Qt\Tools\CMake_64\bin\cmake.exe -E capabilities
fails to run.Which case do you have?
-
In order to find out if Qt Creator for some reason has some borked settings in
"%appdata%\QtProject\qtcreator
you can start:$ C:\Qt\Tools\QtCreator\bin\qtcreator.exe -temporarycleansettings
-
C cristian-adam referenced this topic on
-
I have the same issues about two days now, I had clean the registry, also all qt settings on other locations that isn't the drive c qt installation, uninstall qt, I did this many times and I also have a working qt install on another computer which I exchange the install qt folder and in my problem computer it won't work and the qt installation folder works on another computer, system oaths is the same, so I came down to operating system issues, I use dependency walker to see what uic.exe requires and in my computer about 4 ot 5 dll it calls and the other computer It call a number of windows kit dll, installing the kit disnt help, I am currently running windows repairs well I will update you guys of my findings
-
I had the same problem when I was trying to debug my app and gdb stopped responding, so I closed QtCreator (version 17.0.2) and apparently instead of properly closing and writing its settings as it usually does, it crashed and botched some file(s). After opening QtCreator again both system CMake (I'm on Linux Mint 22.2) and qt-bundled one were showing "version not parseable". Running qtcreator -temporarycleansettings as was suggested above didn't have this issue. So in my case the issue apparently was caused by ~/.config/QtProject/QtCreator.ini inside which there was a section
[%General] DefaultFileEncoding=@ByteArray(UTF-8) DefaultLineTerminator=1 LastPreferencePage=K.CMake.Tools OverrideCodecForLocale=@ByteArray(037) OverrideLanguage=C SortCategories=false
After I removed this section and opened QtCreator again, everything was fine. So I guess this incorrect section somehow messed with QtCreator parsing its .ini
Also interesting that along with this incorrect section there was also normal correct [General] section, and it had no keys/values like the incorrect one.