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

Run configurations (wrongfully?) removed if cmake target is removed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • Qt Creator 12.0.0
    • Qt Creator 7.0.2, Qt Creator 8.0.1, Qt Creator 9.0.2, Qt Creator 10.0.0, Qt Creator 12.0.0-beta2
    • None
    • All
    • b1876052b (master)

      I'm running QtCreator 7.0.2 with a cmake project on macOS.

      Whenever cmake is run and an executable target that used to exists is removed, QtCreator removes the corresponding run configurations from the project.

      I can see how that can be useful for the automatically created run configurations that weren't customized. But it's quite irritating when I've customized a run configuration (e.g. set up some command line arguments). For me it's quite frequent that targets change, for example when I switch between different feature branches with different sets of targets.

      This would also happen when I rename a target in cmake. Instead of retaining the run configuration and manually updating the executable, I have to recreate it. Another case is when you are debugging your cmake configuration itself, and maybe temporarily commenting out some add_subdirectory or similar. When the cmake run succeeds, the corresponding run configurations are gone.

      I think this is new behaviour. Maybe I'm wrong, but I seem to remember that in some earlier version the run configurations were kept (but the executable was shown in red when it didn't exist as a target). But I can't say which version this might have changed.

      Is there some way to make QtCreator not automatically remove the run configurations? I checked in the settings, but didn't find anything that sounded related. If not, it would be great if this could be added.

      Repro:

      1. Clone project from https://github.com/NikolausDemmel/cmake_demo
      2. Open Project in QtCreator
      3. Add run configuration for target foo (if not set up automatically; depends on your settings).
      4. Set some command line arguments.
      5. Comment out executable foo in CMakeLists.txt and run cmake
      6. Observe that run configuration for foo is gone.
      7. Remove comment again and run cmake
      8. Observe that run configuration for foo is still gone.

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

            kandeler Christian Kandeler
            demmeln Nikolaus Demmel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes