Results 1 to 3 of 3

Thread: QtCreator project with libs, apps. Deployment to end user.

  1. #1
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QtCreator project with libs, apps. Deployment to end user.

    Hi,

    My setup: QtCreator 2.6.2, Qt 5.0.1, Linux slackware 32bit (current).

    I'm trying to setup my QtCreator (or "pro" file?), so I can build application which has 1 shared library and 2 applications - both linking dynamically to that library. I've created Subdirs project, added library project, added 2 application projects, everything builds fine and runs fine under QtCreator.

    Problem is that when the time comes and I'd like to prepare package for end users I need to have directory structure somehow like:
    Qt Code:
    1. MyApp/
    2. lib/
    3. App1
    4. App2
    To copy to clipboard, switch view to plain text mode 
    and the problem here is that linker won't see those libraries. One solution is to add ./lib to LD_LIBRARY_PATH, but 1) this is not very nice solution, requires scripts for running the app, 2) it's not portable and I want to deploy my App to windows and mac in future.

    How should it be done? How to tell QtCreator to create application binaries which point to specific relative path, regardless of platform? I assume that for final "Release" configuration I would have fixed directory structure and I can provide fixed relative paths for libs.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QtCreator project with libs, apps. Deployment to end user.

    How to tell QtCreator to create application binaries which point to specific relative path, regardless of platform?
    I guess relative to the path containing the .pro file.
    Qt Code:
    1. # this will create the binary in the .pro file path
    2. DESTDIR = $$_PRO_FILE_PWD_
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator project with libs, apps. Deployment to end user.

    EDIT:
    Forget below. Just found http://qt-project.org/doc/qt-5.0/qtdoc/deployment.html Thread can be closed.


    No, I don't mean "how to tell where to create binary". I mean "how to tell the binary application where is the library placed in relative position to the application binary" - in a portable way.

    EDIT:
    In other words:
    Is there a way to define in qmake, that my "App1" should look for dynamically linked libraries in a subdirectory "./lib/"?

    I want to be able to build on unix:
    Qt Code:
    1. App/
    2. lib/
    3. libapp.so
    4. app1
    5. app2
    To copy to clipboard, switch view to plain text mode 
    and on windows
    Qt Code:
    1. App\
    2. lib\
    3. app.dll
    4. app1.exe
    5. app2.exe
    To copy to clipboard, switch view to plain text mode 
    by just defining "app" library to be a dynamically loaded library in app1 and app2 binary applications.
    Last edited by googie; 28th February 2013 at 21:32.

Similar Threads

  1. QtCreator weird error while trying to use libnotify libs
    By hakermania in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2011, 11:42
  2. Some questions about using libs in my project
    By alexandernst in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2010, 23:41
  3. Mac OS X and closed source apps deployment?
    By 0xl33t in forum Installation and Deployment
    Replies: 3
    Last Post: 10th July 2009, 09:30
  4. Replies: 2
    Last Post: 24th May 2009, 17:05
  5. Using qmake to build multiple apps and libs
    By marchand in forum Newbie
    Replies: 2
    Last Post: 12th June 2006, 17:33

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.