| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 4 | |
Anyone know how to get the QT integration in eclipse to properly recompile the correct files when working on a project and modifying a header file? I'm constantly having to rebuild my entire project from scratch because I've changed a header file somewhere that only affects some of my files. The makefile eclipse generates does this but the makefile generated by the qt integration does not. Other than that though, just standard using QT very recently and I have to say I absolutely love it! =) Thanks, Stephan -- [ signature omitted ]
On Tue, Dec 25, 2007 at 08:42:34PM +0100, Stephan Rose wrote: > Anyone know how to get the QT integration in eclipse to properly > recompile the correct files when working on a project and modifying a > header file? > > I'm constantly having to rebuild my entire project from scratch because > I've changed a header file somewhere that only affects some of my > files. > > The makefile eclipse generates does this but the makefile generated by > the qt integration does not. > Look to .pro file of your project. All your headers should be added to "HEADERS" variable: HEADERS + = \ foo.h \ bar.h \ other.h -- [ signature omitted ]
Attachment:
signature.asc
Description: Digital signature
On Wed, 2007-12-26 at 00:17 +0200, Dmitry Nezhevenko wrote: > On Tue, Dec 25, 2007 at 08:42:34PM +0100, Stephan Rose wrote: > > Anyone know how to get the QT integration in eclipse to properly > > recompile the correct files when working on a project and modifying a > > header file? > > > > I'm constantly having to rebuild my entire project from scratch because > > I've changed a header file somewhere that only affects some of my > > files. > > > > The makefile eclipse generates does this but the makefile generated by > > the qt integration does not. > > > > Look to .pro file of your project. All your headers should be added to > "HEADERS" variable: > > HEADERS + = \ > foo.h \ > bar.h \ > other.h > Dmitry, thanks for your response. All files already are listed in the .pro file so that isn't the problem. But that's just a listing of header files in the project. That doesn't define what header files are included in which source files. I know eclipse normally scans the source files and builds a list of dependencies which seems to be a step that is skipped with the qt integration. None of the dependency files that eclipse normally generates are present. Thanks, Stephan -- [ signature omitted ]
On Tue, Dec 25, 2007 at 11:31:13PM +0100, Stephan Rose wrote: > All files already are listed in the .pro file so that isn't the problem. > But that's just a listing of header files in the project. That doesn't > define what header files are included in which source files. > This is not _just_ listing of header files in project. ".pro" file is source file for Makefile (that is generated by qmake). qmake scans all header/source files from .pro and generate correct Makefile with all required target dependencies. However there is some problem with this such Makefile generator and looks like it isn't solved by Qt integration plugin: If you decide to include some local header file to source, you _should_ launch qmake again to update Makefile target dependencies, elsewhere, this source file will not be rebuilded automatically after modifying header. So basically just run "qmake" to refresh target dependencies in Makefile. PS. There exists build systems that don't have such problems, like CMake. -- [ signature omitted ]
Attachment:
signature.asc
Description: Digital signature
On Wed, 2007-12-26 at 00:47 +0200, Dmitry Nezhevenko wrote: > On Tue, Dec 25, 2007 at 11:31:13PM +0100, Stephan Rose wrote: > > > All files already are listed in the .pro file so that isn't the problem. > > But that's just a listing of header files in the project. That doesn't > > define what header files are included in which source files. > > > > This is not _just_ listing of header files in project. ".pro" file is > source file for Makefile (that is generated by qmake). > > qmake scans all header/source files from .pro and generate correct > Makefile with all required target dependencies. > > However there is some problem with this such Makefile generator and looks > like it isn't solved by Qt integration plugin: If you decide to include > some local header file to source, you _should_ launch qmake again to > update Makefile target dependencies, elsewhere, this source file will not > be rebuilded automatically after modifying header. > > So basically just run "qmake" to refresh target dependencies in Makefile. > > PS. There exists build systems that don't have such problems, like CMake. > Actually, I think I just found it after a bit more googling. Seems like the "DEPENDPATH" variable for the .pro file is what was missing. Adding that with the proper directory locations for my header files seems to have done the trick. That really is something that should be automatically handled by the qt integration then. Not a big deal now that I know about it but it would make life easier and cozier and I'm all for that! Sorry about my previous response ending up in the wrong thread by the way. Just noticed it, clicked the wrong message. =) Thanks, Stephan -- [ signature omitted ]
On Wed, Dec 26, 2007 at 12:04:12AM +0100, Stephan Rose wrote: > > Well the qt integration actually does already run qmake everytime I do a > build automatically to refresh the makefile. However, I did as you > suggested and ran it manually, even removed the old generated makefiles > first. > > That worked just fine, it did it's job, created the new makefiles. > > However, the dependency thing is not working right for me. I have one > file in my project, Scalar.h, that is included in virtually *every* file > that isn't purely UI related. My project is a CAD project and Scalar.h > defines a multi-unit capable scalar type so it is the very foundation > everything else builds on top of. There is virtually nothing that > doesn't use it one way or another. > > So any change to Scalar.h should cause a recompile to almost the entire > project but it only caused a recompile to about 5 files which makes no > sense. > > I even checked the .pro file to make sure every single header and source > file is listed and they are. Nothing seems to be missing there. > I think, that you should try to create little test case, like small project with a few source files and include files. And try to reproduce it. -- [ signature omitted ]
Attachment:
signature.asc
Description: Digital signature