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

Invalid codemodel file generated by CMake

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P2: Important P2: Important
    • None
    • Qt Creator 4.11.0
    • Debian GNU/Linux bullseye/sid
      Linux 5.5.0-1-amd64
      x86-64
      Qt Creator 4.11.0 based on Qt 5.12.5
      cmake version 3.16.3
      gcc version 9.3.0 (Debian 9.3.0-10)
    • Linux/X11

      When I open with qt-creator a cmake project already configured and compiled, and if I switch from one compilation type to another (like from Debug to Release) I obtain the following error message : "Invalid codemodel file generated by CMake" and the project cannot be compiled anymore.

      Steps to reproduce :
      1. run cmake from the command line in a directory buildDebug, and specifying Debug build type
      2. run cmake from the command line in a directory buildRelease, and specifying Release build type
      3. run make from the command line in buildDebug
      4. run make from the command line in buildRelease
      5. open the CMakeLists.txt with qt-creator
      6. select the Desktop kit
      7. specify directories buildRelease and buildDebug for Release and Debug build type
      8. switch from Debug to Release 

      Note that before step 8, there is no issue. cmake can be run again from qt-creator. The build in Debug does not re-compile everything since sources have not change. The executable can be run correctly from qt-creator. 

      This is what qt-creator printed to the terminal:
      Cannot update Qt version information: /usr/lib/x86_64-linux-gnu/qt4/bin/qmake cannot be run.
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      SOFT ASSERT: "!tcd.tcs.isEmpty()" in file /build/qtcreator-lWks33/qtcreator-4.11.0/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp, line 324
      QFSFileEngine::open: No file name specified
      QIODevice::read (QFile, ""): device not open
      QFSFileEngine::open: No file name specified
      QIODevice::read (QFile, ""): device not open
      QFSFileEngine::open: No file name specified
      QIODevice::read (QFile, ""): device not open
      QFSFileEngine::open: No file name specified
      QIODevice::read (QFile, ""): device not open
      "Invalid codemodel file generated by CMake."
      Cannot update Qt version information: /usr/lib/x86_64-linux-gnu/qt4/bin/qmake cannot be run.

      One solution is to clear the cmake configuration from qt-creator, run cmake from qt-creator, then build. With these steps, the error message is gone and the project is correctly configured. But it re-build every sources even if they were already compiled before... 

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

            thibaultlejemble thibaultlejemble
            thibaultlejemble thibaultlejemble
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes