[Development] Visual Studio generator "autogen"
Scott Bloom
scott at towel42.com
Wed Apr 15 20:05:09 CEST 2026
Just an update.
It took a bit, but I have it worked out, and I found some issues.
First, the documentation should show an example of setting QT_TARGETS_FOLDER and when it should be set. Primarily because of lunkheads like myself who assumed it was a variable and not a property. Even though the documentation clearly says it is a property. That’s on me, but I bet I'm not the only one.
Second, setting it without calling qt_standard_project_setup, only changes the locations for some projects. The designer plugin autogen projects do NOT follow the property
Third, setting it after the call qt_standard_project_setup, has the effect as above. Except now the plugin autogens do follow the property, but in the default location (not the one I explicitly set)
To get the desired behavior, I set the property before the call to qt_standard_project_setup and I get the results I want.
Thanks for the help.
Scott
-----Original Message-----
From: Scott Bloom
Sent: Wednesday, April 15, 2026 10:43
To: 'Joerg Bornemann' <joerg.bornemann at qt.io>; development at qt-project.org
Subject: RE: [Development] Visual Studio generator "autogen"
Qt version 6.11.0 in C:/Qt/install/6.11.0/li cmake version 4.2.3-msvc3 VS 2026
My projects in general, are not "Qt only" and I have been using CMake and Qt for about 15 years now. So I have tons of my own scripts/modules for working with them. (Note I forget which Qt Dev Days it was but I presented a "Using CMake with Qt" about 12 years or so ago.)
For the most part I do not use the "qt_standard_project_setup()" I don’t usually use the auto functionality, for a host of reasons.
However, I have recently been developing a number of Qt Designer Plugins for a project I am working on. Mostly for intellectual curiosity, as in the past I mostly just promoted to the custom widget. Unfortunately, I have not been able to reproduce the steps that automoc creates for the plugins, so I am using it only in those projects.
This is when I have been hitting the random folders propagating.
Ill play with the QT_TARGETS_FOLDER and see if things clean up.
Thanks
Scott
-----Original Message-----
From: Joerg Bornemann <joerg.bornemann at qt.io>
Sent: Wednesday, April 15, 2026 07:10
To: Scott Bloom <scott at towel42.com>; development at qt-project.org
Subject: Re: [Development] Visual Studio generator "autogen"
On 4/9/26 12:44 AM, Scott Bloom wrote:
> When I use AUTO functionality for qt and cmake, it generates
> additional targets, that tend to clutter the IDE solution.
>
> I always run with
>
> set_property( GLOBAL PROPERTY USE_FOLDERS ON )
[...]
> First, doesn’t anyone know how to set the folder property on the
> autogen targets?
>
> Second, what do people think about adding a
> “QT_GENERATED_TARGETS_FOLDER” into the Qt cmake flow, so this is done
> automatically?
With a recent enough Qt and using qt_standard_project_setup() [1] I don't see the target clutter.
Which versions of
- Qt
- CMake
- Visual Studio
are you using?
Also, there is QT_TARGETS_FOLDER [2] which seems to serve the purpose of your proposed QT_GENERATED_TARGETS_FOLDER.
I have mentioned this also the last time you brought this up:
https://lists.qt-project.org/pipermail/development/2025-October/046663.html
Cheers,
Joerg
[1] https://doc.qt.io/qt-6/qt-standard-project-setup.html
[2] https://doc.qt.io/qt-6/cmake-global-property-qt-targets-folder.html
More information about the Development
mailing list