Results 1 to 13 of 13

Thread: QMake make install problems

  1. #1
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    7
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question QMake make install problems

    Hi,

    I am trying to use QMake's INSTALLS variable, but it adds files to innstall (in Makefile), only if the files have been already created.
    The problem i have that out file is not compiled yet, right. So QMake does not add this file to install list. Is there any way to force QMake to use not created yet files in install?

  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: QMake make install problems

    What do you mean by "not created yet"? When do you want to create them?

  3. #3
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    7
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    Quote Originally Posted by wysota View Post
    What do you mean by "not created yet"? When do you want to create them?
    The project is a lib, i want that make install will cp all .so to /usr/lib, but so file is created only after i run 'make', if those files are not created yet QMake does not add them to the install list. So when i run 'make install' only headers are copied.
    If i run 'make', then 'qmake -makefile' and then 'make install' only then .so files are in Makefile and copied to /usr/lib

    Sorry, i hope it's clear enough now.

  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: QMake make install problems

    Ok, I take it that the library name is held in the TARGET variable as usual. Then all you have to do is add the following to your project file:
    Qt Code:
    1. target.path = /usr/lib
    2. INSTALLS += target
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to wysota for this useful post:

    cookiem (8th November 2006)

  6. #5
    Join Date
    Jan 2006
    Location
    Dublin, Ireland
    Posts
    7
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    Quote Originally Posted by wysota View Post
    Ok, I take it that the library name is held in the TARGET variable as usual. Then all you have to do is add the following to your project file:
    Qt Code:
    1. target.path = /usr/lib
    2. INSTALLS += target
    To copy to clipboard, switch view to plain text mode 
    It was a custom variable. Now it works!

    Thank You very much!

  7. #6
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    I made the same mistake and used a custom name...

    However, I have some additional questions:

    1.) If I add a line

    target.files += file1 file2 file3

    it doesn't work anymore. Why not ? Is the usage of += not allowed ?

    2.) In addition to the application binary I want to install the *.qm language file (which are not yet created when calling qmake, too). How can I do that ?

    3.) Where can I find a complete documentation about all these variables ?
    Especially a list of all reserved names (like "target") and the available fields (.path, .files, .depends, .comands, ...) would be very helpful.

  8. #7
    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: QMake make install problems

    You can create a separate installation point, independant of target. Then you can use variables. Just make sure the files you add to it are contained in a separate variable and add that variable instead of separate files.

  9. #8
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    What do you mean when you talk about a separate "installation point" ? I tried the following

    Qt Code:
    1. QMFILES = file1.qm file2.qm file3.qm
    2. target.path = /opt/myapp
    3. tstarget.path = /opt/myapp
    4. tstarget.files = $$QMFILES
    5. INSTALLS += target tstarget
    To copy to clipboard, switch view to plain text mode 

    but it doesn't work .

  10. #9
    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: QMake make install problems

    The following works for me just fine:

    INSTALL_HEADERS += widgets/wwglobal.h
    INSTALL_HEADERS += $$wwHeaders(WWWIDGETS)

    flat_headers.files = $$INSTALL_HEADERS
    flat_headers.path = $$[QT_INSTALL_HEADERS]/wwWidgets
    INSTALLS += flat_headers

  11. #10
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    Thank you for your reply, but I don't know how to apply this to my problem.
    I don't have any header-files and also no environment value like WWWIDGETS...

    Could you give another short example with just a simple application myApp and two translation binaries file1.qm and file2.qm ?

  12. #11
    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: QMake make install problems

    This is a real world example, ignore the variable names, focus on the syntax. In my case INSTALL_HEADERS contains a list of files to copy, that's all you need to know.

    In your case it'd be something like:
    INSTALL_TRANSLATIONS += file1.qm file2.qm
    transinstall.files = $$INSTALL_TRANSLATIONS
    transinstall.path = /opt/something
    INSTALLS+=transinstall

    Remember that you have to run qmake after files file1.qm and file2.qm are created for this to work.

  13. #12
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake make install problems

    Remember that you have to run qmake after files file1.qm and file2.qm are created for this to work.
    But that's the point ! qm-files are create during make and make is called after qmake...
    So I have to call qmake twice during the build+installation process !

    qmake => creates makefiles
    make => builds application binaries
    make translation => creates translation binaries (qm-files)
    qmake => creates makefiles again !!!
    make install => installs application+translation binaries

    The problem is, that the first qmake ignores all install-target files that are not yet built.
    For the application binary, Trolltech seems to have implemented a "special" solution with the reserved "target" target.
    But there seems to be no such a solution for other files, right ?

  14. #13
    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: QMake make install problems

    Quote Originally Posted by Comer352l View Post
    But that's the point ! qm-files are create during make and make is called after qmake...
    So I have to call qmake twice during the build+installation process !
    qm files are not created by make. At least not by default - qm files are created by calling lrelease on the project file. You don't need to recreate qm files during every compilation, only once during a final release (you can work on ts files in the meantime). I'm sure calling qmake once more in this situation is not a problem.

Similar Threads

  1. Mac OS X install problems
    By rickbsgu in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2006, 06:31
  2. Mac OSX install Tiger intel&ppc qmake
    By patrik08 in forum Installation and Deployment
    Replies: 3
    Last Post: 6th July 2006, 18:54
  3. make install with debug_and_release_target
    By aba in forum Qt Programming
    Replies: 0
    Last Post: 17th April 2006, 19:28
  4. make install equivalent in qmake ...
    By momesana in forum Newbie
    Replies: 3
    Last Post: 20th February 2006, 21:46
  5. Replies: 1
    Last Post: 11th January 2006, 14:15

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.