Results 1 to 4 of 4

Thread: Using qmake to build ordinary C++ projects on differente computers

  1. #1
    Join Date
    Sep 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Using qmake to build ordinary C++ projects on differente computers

    Hi,

    I've decided to use Qt Creator as a C++ IDE even for non-Qt projects. I'm coding it in the desktop pc, but I need to build the files on several different netbooks. I don't really know the reason, but the generated output executable file (using linux) in the desktop doesn't work on the netbooks. So I would like to just qmake/ make, in these netbooks to build the projects on them, without having to do it by hand using gcc, or creating myself a makefile, since qmake is pretty easy to code. Is it possible to do that?

    Thanks in advance,
    Luiz.

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using qmake to build ordinary C++ projects on differente computers

    Moving executables around between different Linux distributions is notoriously difficult. If you want to make sure a binary built on your desktop will work on the netbooks you have to either ensure that all the libraries you use are present on the netbooks in a version compatible to that you link against on your desktop. As this is unlikely to be the case, you should either copy ship these libraries along the executable or use static linking.

    Assuming you already have the required compiler and libraries on the netbooks but cannot afford the overhead of installing the whole Qt SDK just to use qmake there are two options :
    • switch to another build system (e.g. CMake) which can be installed standalone, contrary to qmake
    • copy the qmake binary (same remark about libs but I think qmake doesn't have too many dependencies) and the content of /usr/share/qt/mkspecs (or wherever the mkspecs are stored on your desktop) to the netbooks
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Sep 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using qmake to build ordinary C++ projects on differente computers

    Quote Originally Posted by fullmetalcoder View Post
    Moving executables around between different Linux distributions is notoriously difficult. If you want to make sure a binary built on your desktop will work on the netbooks you have to either ensure that all the libraries you use are present on the netbooks in a version compatible to that you link against on your desktop. As this is unlikely to be the case, you should either copy ship these libraries along the executable or use static linking.

    Assuming you already have the required compiler and libraries on the netbooks but cannot afford the overhead of installing the whole Qt SDK just to use qmake there are two options :
    • switch to another build system (e.g. CMake) which can be installed standalone, contrary to qmake
    • copy the qmake binary (same remark about libs but I think qmake doesn't have too many dependencies) and the content of /usr/share/qt/mkspecs (or wherever the mkspecs are stored on your desktop) to the netbooks
    Thank you very much for your answer.
    I moved to cmake. But, can Qt generate a CMakeLists instead of a qmake .pro ? This way I wouldn't even have to bother to write the CMakeLists myself.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,734
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using qmake to build ordinary C++ projects on differente computers

    No. You have to write and maintain the CMakeLists.txt file. Detecting if a CMakeLists.txt file changes and offering to rerun CMake for you is about the limit of the support.

Similar Threads

  1. Replies: 1
    Last Post: 24th August 2011, 13:51
  2. Replies: 2
    Last Post: 7th September 2010, 21:19
  3. How to code an App that will build QT projects
    By locke in forum Qt Programming
    Replies: 12
    Last Post: 24th August 2010, 12:48
  4. Replies: 1
    Last Post: 15th June 2010, 13:25
  5. QMake for non-qt projects
    By rubenvb in forum Installation and Deployment
    Replies: 3
    Last Post: 25th October 2009, 13: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.