[Qt-creator] What to click after changes in CMake project files?

Eike Ziller Eike.Ziller at qt.io
Wed Nov 25 09:45:51 CET 2020



> On Nov 25, 2020, at 09:38, Eike Ziller <Eike.Ziller at qt.io> wrote:
> 
> You are right that it should re-run cmake automatically,

Clarifying that: it should re-run CMake automatically when you save CMakeLists.txt files.
You need to explicitly apply configuration changes in Projects mode (but I think you are also asked to do that at some point).

> and seems not to, even though it seems to reparse the project (probably based on the old data).
> 
> Either “Run CMake” or just building (since CMake will automatically run itself) will result in Qt Creator getting the update of changed CMake files. It really does what the title suggests - it runs CMake in your build directory.
> 
> “Apply Configuration Changes” is only available if you changed the configuration values in that screen, and runs CMake with the corresponding -DVAR=VALUE or -UVAR arguments. So it basically includes “Run CMake”. Note that because of how _CMake_ works, a single run of CMake might not be enough to actually apply these completely, you might need to run cmake again (or CMake does it automatically when building, hopefully).
> 
> “Rescan project” is just a “something went wrong, try to get the data from CMake again (without actually running CMake)”. That should probably move to a less prominent place.
> 
> Do not “Clear” the CMake configuration, or be prepared to loose all configuration changes that you made in Projects mode, re-running CMake with the “Initial CMake Arguments” and completely rebuild your project.
> 
> Br, Eike
> 
>> On Nov 25, 2020, at 09:09, Richard Weickelt <richard at weickelt.de> wrote:
>> 
>> There are several options to run CMake in QtCreator:
>> 
>> - Apply Configuration Changes in the build settings pane
>> - Clear CMake configuration
>> - Run CMake
>> - Rescan project
>> 
>> I am a bit lost. I would expect that QtCreator would figure out
>> automatically when something in the project files has changed and re-resolve
>> the project as necessary, but that doesn't seem to be the case.
>> 
>> After doing a significant changes to some CMake project files (introducing
>> new config variables, adding source files, adding dependencies), what do I
>> need to click in which order so that the next build takes all changes into
>> account?
>> 
>> Thanks
>> Richard
>> 
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> https://lists.qt-project.org/listinfo/qt-creator
> 
> -- 
> Eike Ziller
> Principal Software Engineer
> 
> The Qt Company GmbH
> Erich-Thilo-Straße 10
> D-12489 Berlin
> eike.ziller at qt.io
> http://qt.io
> Geschäftsführer: Mika Pälsi,
> Juha Varelius, Jouni Lintunen
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list