Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 14.0.0
-
None
-
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).