[Qt-creator] Generating .pro file from a Makefile?

andre.poenitz at nokia.com andre.poenitz at nokia.com
Thu Mar 15 17:24:06 CET 2012



Sean M. wrote:
> I may be barking up the wrong tree here, but here goes:
>  
> I’ve got a program written in C that I’ve inherited from a former co-worker, 
> that comes with little to no documentation.  It has a working Makefile already.
> 
>  I’m attempting to learn how it works via reading the source code.  Since I’m
>  fairly comfortable with Qt Creator, especially features that would be helpful in 
> this case such as Follow Symbol Under Cursor, Find Usages, etc., I’d like to 
> bring  it in under Creator, ideally just by parsing the existing Makefile and creating
>  a .pro file that matches. 
> 
>  Is there an easy way to do that?  All I know of right now is to just create a 
>  new project, and manually add all the .h & .c files by hand (or doing a 
> qmake -project).  But in some ways, I’m not sure I even want to create a .
>  pro file that  is capable of creating a Makefile, since I don’t really want to 
>  overwrite an existing, perfectly working Makefile…
> Sean

In such cases I usually use a 'qmake -project' generated .pro for editing and 
exploration and the original build files for building. If you have a working 
Makefile, just removing the 'qmake' builds step from the build settings 
should be sufficient.

Sometimes it is necessary to polish it a bit by adding a few DEFINES +=in the 
.pro ir similar, but the approach is typically "good enough".

And since I see Adam's response: I wouldn't recommend the "Generic Project"
over the "Dummy .pro file", as the format of the Generic Project is fairly simplistic,
you can't tinker much there. In a .pro you can use conditionals, check environment
variables etc, i.e. cover the ground between "Just a file list" and "A fully working .pro file".

Regards
Andre'








More information about the Qt-creator mailing list