Results 1 to 5 of 5

Thread: Mac: Copy Files Build Phase and qmake...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Mac: Copy Files Build Phase and qmake...

    Thanks for the hint but I still can't get it working. As far as I can tell you're supposed to create an install set as follows in your project file:

    frameworks.path = myApp.app/Contents/Frameworks
    frameworks.files = path/to/framework/*

    INSTALLS += frameworks

    I've tried this and nothing happens when I build my project in Xcode. Is there something else you need to do to get Xcode to "install" the files?

    I've even created a minimal project file if anyone else wants to try it out and confirm that it doesn't work, or point out what I'm doing wrong.

    qmakeTest.pro
    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) Fri Sep 21 15:16:49 2007
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET = qmakeTest
    7. DEPENDPATH += .
    8. INCLUDEPATH += .
    9.  
    10. # Input
    11. SOURCES += main.cpp
    12.  
    13. images.path = qmakeTest.app/Contents/Images
    14. images.files = car.jpg
    15.  
    16. INSTALLS += images
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. w.setGeometry(100, 100, 500, 355);
    8. w.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    car.jpg is just a jpeg file that I want to be installed inside the app bundle in Contents/Images.

    Steps to follow:
    1. Put qmakeTest.pro, main.cpp & car.jpg (or your own file) in a folder.
    2. Run "qmake qmakeTest.pro"
    3. Open the generated Xcode project and build it.
    4. Look inside the application package and notice that there is no Images folder anywhere to be found.


    As far as I can tell this is how it should be done but nothing happens when I build the Xcode project. Any suggestions?

    Thanks

    Dave Thorup
    Bibble Labs

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Mac: Copy Files Build Phase and qmake...

    I use make instead of XCode. With make, the install target is "install". So here's what I do to build and populate the app bundle on Mac:

    make
    make install

  3. #3
    Join Date
    Aug 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Mac: Copy Files Build Phase and qmake...

    I'm not really interested in using makefiles though, I want to do this all within Xcode. Is there a way to do it in Xcode?

    Thanks.

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
  •  
Qt is a trademark of The Qt Company.