Results 1 to 6 of 6

Thread: making Eclipse recognize project dependnecies with qmake?

  1. #1
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question making Eclipse recognize project dependnecies with qmake?

    I'm using a setup where I'm describing my projects using qmake project files, and generate GNU Makefiles based on these. I'm using Eclipse CDT as an IDE, but unfortunately it does not recognize cross-project dependencies.

    for example, I have a range of libraries as separate projects, and then a range of executables that depend on various libraries. libraries may also depend on other libraries.

    because Eclipse does not recognize the dependencies, whenever I change something in a library and build it, I have to clean and re-build dependent applications afterwards. this is rather inconvenient.

    is there a 'proper' way to specify library dependencies in qmake project files? even in a way that would be recognized by Eclipse aftewards?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: making Eclipse recognize project dependnecies with qmake?

    This is a very hard thing to achieve, because you are depending on a library (*.so, *.a) from another project, which is fine. But the library itself depends on its source files and possibly on other libraries. Unless you monitor changes to all these files there is not much you can do. What you can do is to force calling make each time on every dependent library so that make checks those. You can do that through qmake's system() function.

  3. #3
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: making Eclipse recognize project dependnecies with qmake?

    Quote Originally Posted by wysota View Post
    This is a very hard thing to achieve, because you are depending on a library (*.so, *.a) from another project, which is fine. But the library itself depends on its source files and possibly on other libraries. Unless you monitor changes to all these files there is not much you can do.
    I'm not sure this is true. The library will be recompiled anyway, because some if its source files changed. then the library will have a newer timestamp than the executable that depends on it.

    currently, this is not taken into account, and the executable is not re-linked againts the library. when building the executable, neither the timestamp of the library is taken into account, nor is a make issued for dependent projects.

    if this could be achieved, I'd be more than happy (and would solve my problems)

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: making Eclipse recognize project dependnecies with qmake?

    Quote Originally Posted by akos.maroy View Post
    I'm not sure this is true. The library will be recompiled anyway, because some if its source files changed. then the library will have a newer timestamp than the executable that depends on it.
    From what I undestood you wanted the library to be recompiled automatically. If that's not the case then there is no problem. Add the library to PRE_TARGETDEPS qmake variable.

  5. #5
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: making Eclipse recognize project dependnecies with qmake?

    Quote Originally Posted by wysota View Post
    From what I undestood you wanted the library to be recompiled automatically. If that's not the case then there is no problem. Add the library to PRE_TARGETDEPS qmake variable.
    thanks for the tips. actually I have had to settle for the following:

    Qt Code:
    1. LIBS += -L../libFoo/lib -lfoo \
    2. -L../libBar/lib -lbar
    3.  
    4. INCLUDEPATH += ../libFoo/include ../libBar/include
    5.  
    6. PRE_TARGETDEPS = ../libFoo ../libBar
    7.  
    8. DEPENDPATH += $$INCLUDEPATH
    To copy to clipboard, switch view to plain text mode 

    what is strange for me here is that basically I have do define my dependencies twice in a way. after all, I already specify where to find include files & where my libraries are. and then I have to specify again that I actually depend on those include files & libraries. for me this seems kind of obvious - if I include or link something, I depend on it

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: making Eclipse recognize project dependnecies with qmake?

    I can tell you that you can find elephants in Africa, but that doesn't yet determine you actually need to find an elephant right now.

Similar Threads

  1. making qmake create VisualStudio console app project file?
    By akos.maroy in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 14:45
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. Howto use Eclipse with QT4 in 10 steps
    By the_bis in forum Newbie
    Replies: 3
    Last Post: 28th January 2007, 20:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.