[Qt-creator] Refactoring the CMake plugin
Hunger Tobias
Tobias.Hunger at digia.com
Fri Jun 20 10:10:32 CEST 2014
On 19.06.2014 23:29, Benjamin Zeller wrote:
> Am 19.06.2014 00:13, schrieb Miller Henry:
>> On question 3:
>>
>> When switching project configurations, if the build is at all out of date the first thing I'm going to do is re-run make anyway. The only other option that makes sense it to completely blow away the build directory and re-run cmake. I would go so far as making it an option to just run a full build anytime I switch my build configuration (default to true as it is what the user wants even though it violates some purists expectation that no files will be written). I find it very annoying to have this cmake dialog pop up when I open an out of date build, as I'm just going to hit run and wait for it to complete. So long as no build option is being changed, I want qt creator to write the files it needs and not bother me.
> Thats almost what my current patch is doing, it runs cmake in the
> background when you change
> configurations, always, without popping up the dialog.
> If you want to change arguments you can do so in the build settings.
> CMake will then
> be run automatically in the background when you leave the lineedit you
> changed your settings in.
> However this does create files without notice which is really a problem
> when for example you change
> the builddir many times, you might end up with n buildfolders on your
> harddisk.
You could only run cmake if the builddir already exists and have the
user go through the run cmake dialog otherwise.
> I think it would probably be possible to run cmake automatically when
> you finished editing a cmake
> file, because in that case you did not change any builddir settings. You
> can again say that there might
> be cases when new files are created on the harddisk, but only in the
> builddirectory you specified anyway
> so I think that should be acceptable, right?
I think so, yes. I am not the maintainer though:-)
My personal opinion is that the builddir is property of the build system
and it is basically free to do in there what it wants. Creator just
should not add random directories (build directories and of course
others as well) without being very explicit about it doing that.
>> Now if the cmake dialog acted more like ccmake and let me change cached options that might be useful: the only thing valid to do from the cmake dialog in an existing build directory is change options that ccmake could change for you, but since I only have access to the command line of cmake this isn't convenient. I'm not sure if the cmake cache files are in a stable format where it would be valid for qt creator to do this, but it would be ideal.
> Hm i wonder if cmake has some embeddable tool we could use for that.
>>
>> One annoyance I have is once in a while an automated build fails, when I open qt creator it tries to run cmake, which fails because of a syntax error. There is no easy way to open the offending file in qt creator so I can fix the error(s). If you can do something about this I'd be grateful. At least I'd like it if an outdated project configuration could be used because that will have 95% of what I need.
> Also almost what the patch does, but what will not work of course is
> when you open the project for the
> first time and the project file is invalid, then you will only see the
> "root" project file.
> Once the project is open it will not remove the files from the tree when
> you somehow change your
> project file and add a error to it.
Ideally a cmake error would be listed as a build issue, so that you can
get to the right file/line from there. That is independent of whether
the file is actually in the project tree already.
Best Regards,
Tobias
More information about the Qt-creator
mailing list