Specifying run configurations directly in qmake project files
-
Hey there,
qmake works "ok" when generating cross platform build solutions but I think there is one fundamental piece missing.
There is no way to programmatically specify run configurations... I wish I was able to set directly in foo.pro the "Run Settings"
that you can find under QtCreator (see snaphot).Wouldn't that be a very useful thing to have?
-
Qmake is a tool to build stuff. Why would you want to put information on what to run later in there?
You can try to put that information into the .shared file if you want to provide defaults to your coworkers.
-
Currently it is still a bit tricky to set up: Basically you have to copy your user file and then remove everything you do not want to have shared (plus everything specific to your setup).
We so far only tried this for the editor settings, I am not really sure how far you can get with project setup at this time... that is depending on quite a bit of context from your specific Qt Creator setup. Patches are of course welcome via "gerrit":http://codereview.qt-project.org/ :-)
-
[quote author="Tobias Hunger" date="1332531136"]Qmake is a tool to build stuff. Why would you want to put information on what to run later in there?
You can try to put that information into the .shared file if you want to provide defaults to your coworkers.[/quote]Because after you build them you usually want to execute them :)
And from your latest reply, if the .shared is tricky to setup, then it's not really a usable/good solution. -
Well, it is something we are still working on.
It does cover some use cases already (most notably the editor settings), so if you are experimentally-minded you can give it a try. You obviously are a developer -- otherwise you would not use Qt Creator at all -- so you should have the skills to improve the situation if you had the time and urgent need to do so. Surprisingly many people seem to be willing to hack Creator to do what they want nowadays, so I thought it better to point out where hacking could improve the situation instead of just saying "this does not work" :-)
As with any open source project out there: Contributions are highly welcome. So are "bug reports and feature requests":http://bugreports.qt-project.org/ . We try to fix bugs ASAP and to take feature requests into account when planning. Reporting issues here is not as successful as Developers will run into issues reported here mostly by chance: We are paid to hack after all, not to hang out in forums all day long;-).
[edit: fixed link, eddy]
-
I understand the need to be able to specify parts of the run configuration from within the QMake project files. There is the simple use case that a project consists of a library and test cases that use the library. Out of the box, there is no way to tell "make check" where the library is found.
Solving this in Qt Creator is great, but it requires manual intervention for every new setup, and it does not make the tests run outside of Creator. That is where rudimentary support for that in QMake would be better.
Yes, QMake is a build tool. A build today not only consists of assembling artifacts, but also executing some of them, like test cases. The MOC is a good example for that, too, as it first needs to be built, and then needs to be executed. And since the library paths for the dynamic linker depend on the build directory, they are known at QMake time.
-
Tobias I think I understand what you mean. I think indeed the .shared gets quite close to it!
Can you pass along a link to its documentation? By the way, I didn't mean to be harsh in my comment. If it's something it will be improved in the future, it's worth it.Unfortunately this is not a time-critical task for me. It's just something it'd be very good to have in qtcreator.. so I cannot really put time aside for it. I do want to have my own version of the "simplify project tree" though, I hate the .cpp/.h separation.. so truly useless :)
And miroslav provided a use case very similar to mine. In my scenario I have and "app"lication, "p1,p2,p3"arameters and "data1,data2". Consider a scientific tool, where you have multiple use cases which area pre-assembled as a combination of a specific application (the executable, its run-path and environmental variables that it might need) parameters and data...
Having them all written in the .pro and conveniently imported in your IDE of choice would be awesome!!
-
Hey, just a quick update - I wrote a small tool that handles library paths for make test with QMake and wraps make check for that. See here: https://www.agile-workers.com/web/2012/05/qmake-unit-tests-dynamic-libraries
It is on Github and Free Software. Have fun.