[Qt-creator] Defining project dependencies?

Eike Ziller eike.ziller at nokia.com
Mon Nov 3 15:21:10 CET 2008


On Nov 3, 2008, at 2:49 PM, ext Oliver.Knoll at comit.ch wrote:

> Hi there,
>
> with great interest I tried the Qt Creator Technical Preview!
>
> One of the first things I have tried was to setup a Project with  
> several sub-projects, typically the main application ("Qt 4 Gui  
> Application") which depends on several "C++ Libraries".
>
> So first I created ("New") a Qt 4 Gui Application and then another "C 
> ++ Library" Project, but I did not find out how to set a dependency  
> from the application to the DLL.
>
> In the library creation wizard one of the last screens offers:
>
>  Add to Project         [ ]
>  Project                [MainApp.pro]
>  Add to version control [ ]
>
> But all these 3 options are greyed out. So I assume this is "work in  
> progress"?

Actually that page shouldn't be there at all for project wizards. It  
is enabled if you add new files.

> Once the Shared Library has been added besides the other Project I  
> also don't see any way how I would specify the dependency  
> afterwards. In Visual Studio for example I would right-click on the  
> DLL project and choose "Project Dependencies...". In Qt Creator I  
> don't see any such option, not even greyed out or so...

This seems to got lost from the UI...

> So my question would be: is it planned to specify Project  
> dependencies (in the Creator GUI), such that the build order is  
> accordingly and the linker has the correct link settings (so that  
> MainApp.exe links with Utils.dll etc.)? Or am I supposed to hack the  
> *.pro files manually?
> As a side-note: what is the "philosophy" of Qt Creator? Am I  
> supposed to edit the *.pro files? Or are they "Don't touch! Your  
> changes will be lost the next time Qt Creator thinks it is  
> appropriate"? For example I did not find a project "Properties"  
> dialog where I could set the *.exe/*.dll output directory,  
> additional Qt dependencies (QtXml, QtOpenGL etc.), additional  
> INCLUDE/LIB directories etc. and yes, I am thinking "Visual Studio  
> Project Properties" dialog here ;) Is this the direction of the Qt  
> Creator ("edit all the possible QMake options in the Creator GUI"),  
> or is it more "Edit the *.pro files yourself" approach (which would  
> be also fine for now)?

You are supposed to work with pro files directly. We are working on  
providing a more convenient editor for pro files, but it will still be  
mostly text-based.

> And going a bit back again to my Project dependencies problem: can I  
> specify the "output directory", so all *.DLLs and *.exe go into one  
> single output directory (so that the DLLs are found when I start  
> debugging)? Or even more flexible: a desired feature would be  
> "custom build steps", so that I could specify where to copy the  
> resulting binary files, together with additional 3rd party DLL  
> dependencies etc. (in Visual Studio: "Post build step") and then off  
> course: specify which *.exe to debug (namely the one which has been  
> just copied to my final output directory).
>
>
> As of now I will try to "port" my existing Visual Studio project  
> (with "Custom Build Steps" and DLL Project dependencies) to Qt  
> Creator, but it seems there is still a lot of "manual *.pro file  
> hacking" involved.

What you can do at the moment is
* Setting a "build directory" using the "shadow build" checkbox in the  
"general" page of your build configuration. That will call qmake &  
make from the directory you set, so the build results end up in this  
directory.
* Add custom build steps to the build queue, allowing you to run a  
script/executable (use the "+" button below the list of build steps  
(qmake&make) in the "Build steps" page of the build configuration. At  
the moment we only provide execution of scripts, though we might  
extend that with more specialized "custom steps", like copying a list  
of files somewhere.
* Hack the pro file with "QMAKE_POST_LINK += $${QMAKE_COPY_DIR}  
sourcedir destdir $$SEPARATOR" and similar commands

Thanks for the feedback,
Eike




More information about the Qt-creator-old mailing list