Details
-
Suggestion
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 12.0.2
-
None
-
030e3c2cd (14.0)
Description
When using Qt Creator with a cmake project that uses file(GLOB_RECURSE VAR *.cpp) and adding a new class, Qt Creator still switches to CMakeLists.txt and modifies the add_executable directive.
Example CMakeLists.txt:
cmake_minimum_required(VERSION 3.5) project(qt-cmake-test LANGUAGES CXX) file(GLOB_RECURSE FOO_SRC Foo/*.cpp Foo/*.h) add_executable(qt-cmake-test ${FOO_SRC})
When adding a class Something, the last line is changed to:
add_executable(qt-cmake-test ${FOO_SRC} Foo/Something.h Foo/Something.cpp)
(One can select "Add to project: <None>" in the wizard, but this choice is not remembered for next time and Qt Creator still opens and switches to CMakeLists.txt)
To reduce friction, I propose the following:
- Add option to disable automatic modifications to CMakeLists.txt
Alternatively:
- make Qt Creator remember the choice "Add to project: <None>" in the Add Class Wizard
Additionally:
- disable opening of (and switching to) CMakeLists.txt, (especially) if no modifications were made
- Add option to trigger an automatic re-run of CMake after adding a new class
Attachments
For Gerrit Dashboard: QTCREATORBUG-30445 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
543873,2 | CMakePM: Do not add sources to globbed targets | 13.0 | qt-creator/qt-creator | Status: ABANDONED | 0 | 0 |
568749,2 | CMakePM: Do not add sources to globbed targets | 14.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |