Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify build, deployment, and run configuration in a Qt Creator `.pro.shared` file?

Tags:

qt

qt-creator

I can see from the documentation on https://qt-project.org/doc/qtcreator-2.6/creator-sharing-project-settings.html how to create a .pro.shared file that standardizes Editor settings.

But there's no mention of build configurations, build steps, deployment methods, or run configurations.

I tried just renaming my .pro.user file (which includes custom build, deployment, and run configuration) to .pro.shared, but when I reopened the project, I got the defaults.

What's the right way to specify these settings in a .pro.shared file?

like image 906
smokris Avatar asked Dec 21 '12 17:12

smokris


People also ask

How do I create an executable in the custom run configuration QT?

If you want to run some other Python file than main.py , create a custom executable run configuration: Select Add > Custom Executable. In the Executable field, specify the path to the Python executable. In the Command line arguments field, select the Python file to run.

Where to Set Qt environment variables?

You can edit existing environment variables or add, reset and unset new variables based on your project requirements. To globally change the system environment from the one in which Qt Creator is started, select Edit > Preferences > Environment > System, and then select Change in the Environment field.


1 Answers

So short answer: You can't. Those settings are the reason why it is a .user file: They reference settings that are specific to one Qt Creator instance.

Long answer: We are moving to support this use case better, 2.6 was a huge step in that direction. With 2.6 you might be able to share build/deploy/run settings, but you need to make sure everybody using that .user file has compatible kits with exactly the same ids. You also need to make sure that everybody is using the same paths to sources, builds, operating system, etc. which limits its use quite a bit.

This might work e.g. with the Qt 5 kit installed by the official Qt 5 packages or with kits created specially for your setup. This will fail in any setup where you do not have tight control over all the development setups! On the other hand: If somebody is using a non-default setup of creator (kits, paths, etc.) then creator will just throw away some or all kit defined in the .user file of the project and will then continue, asking for kits to use. That is exactly what you will get without a .shared/.user file available at all.

Please be aware that as far as I know nobody ever tested such a setup. So you will most likely run into bugs and misbehavior... if you do: Please file bug reports at https://bugreports.qt.io/ ;-)

If you have only one environment you are targeting with your development, then you can get pretty far by having that environment set up (e.g. you only have one compiler/Qt version/kit defined that is exactly what you want everybody to use). Creator will then just default to that one, even if you have no .user file at all.

like image 175
Tobias Hunger Avatar answered Oct 28 '22 02:10

Tobias Hunger