Qt creator can not parse cmake version after update from Qt 6.5.3 to Qt 6.7.2
-
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.xmlas 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,Idthat is.Or if
C:\Qt\Tools\CMake_64\bin\cmake.exe -E capabilitiesfails 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\qtcreatoryou 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=falseAfter 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.