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

cmake targets not updated in locator

    XMLWordPrintable

Details

    • d982efc5a (15.0), 7199d9fb5 (15.0)

    Description

      The CMake targets are not updated in the locator when they are modified in the CMakeLists.txt.
      Steps to reproduce:

      • Uncheck Qt Creator > Preferences > CMake > Autorun CMake
      • Create a new CMake project and build it.
      • Add a line to the CMakeLists.txt: add_custom_target(foo COMMAND echo foo)
      • Build the project so CMake can reconfigure itself and generate the .json file (untitled/build/Qt_6_8_0_for_macOS-Debug/.cmake/api/v1/reply/target-foo-Debug-3a03d91884c6faa85b4c.json)
      • Open the locator CMD+K and type cm foo

      Expected outcome: foo is recognized by the locator as a CMake target.
      Actual outcome: foo is not recognized by the locator as a CMake target.

      If you can find foo in the locator, try renaming the target in the add_custom_target to something else, rebuild the project and see if you can find the renamed target.

      There is a workaround where you can do Build > Run CMake to make the targets appear in the locator, but its annoying to have to run CMake configure again (especially on bigger projects like Qt where configuration takes from one to few minutes).

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            sami.shalayel Sami Shalayel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes