Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Questions about qmake and the project file
Forum Updated to NodeBB v4.3 + New Features

Questions about qmake and the project file

Scheduled Pinned Locked Moved Qt Creator and other tools
11 Posts 3 Posters 4.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Here's the first few lines of my project's .pro file:
    @######################################################################

    Automatically generated by qmake (2.01a) Mon Mar 28 17:09:16 2011

    ######################################################################

    TEMPLATE = app
    TARGET =
    DEPENDPATH += . headers src
    INCLUDEPATH += . headers

    APP_QML_FILES.files = DemodShaperFilter.qml
    APP_QML_FILES.path = Contents/MacOS
    QMAKE_BUNDLE_DATA += APP_QML_FILES
    @

    A couple of questions:

    1. I know that this file is automatically generated by qmake (after all, it says so in the comment!), but...qmake seems "smart" enough to prevent my modifications from being deleted. At least, running qmake doesn't seem to wipe them out. Can someone confirm this, and perhaps explain how this happens?

    2. My project uses several data files that need to be co-resident with the application binary. It would be really cool if I could have those automatically moved into the same folder that the .qml file in the example above goes into. How might I make this happen?

    Thanks.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      The .pro file is generated by following command:
      @
      qmake -project
      @
      Run qmake -h to get more help.

      Then the created .pro file shoule be edited manually or through IDE such as QtCreator.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        Regarding #1:
        If you call

        @qmake -project@

        your .pro file is wiped out and replaced by the newly generated one. Be careful!

        If you just call

        @qmake@

        then qmake just reads the .pro file and generates Makefile (and probably Makefile.Debug and Makefile.Release) for you.

        Regarding #2:
        You can add your own target in the .pro file, just replace APP_QML_FILES with something you like and adjust the file list.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #4

          Thanks, Volker. So: is a symbol like APP_QML_FILES something I can just make on-the-fly, or is this a reserved keyword in qmake?

          Can I just duplicate those lines rather than replace them? Like APP_COEFF_FILES?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            That's something you can make on the fly. You must make sure to choose a name that's not used elsewhere, so using an application or organization specific prefix for the name - like MYCOMP_ - will be a good idea.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #6

              Good point. So, when does this extra stuff get processed: when qmake is run, or when you push "build" in Creator?

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                When you run build in Creator - or call make on the command line, which is basically the same that Creator does for you :)

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by
                  #8

                  OK, so it's truly part of the make process then. Excellent. I'll go try it now, and come back to ask more questions when I screw it up. Thanks!

                  1 Reply Last reply
                  0
                  • mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by
                    #9

                    Is there a way to put multiple files on a single line? Like:

                    @APP_COEFF_FILES.files = coeffdemodshaper.txt coeffmodnyquist.txt
                    APP_COEFF_FILES.path = Contents/MacOS

                    QMAKE_BUNDLE_DATA += APP_COEFF_FILES
                    @

                    I've tried it with and without a comma, and both give me a build error:

                    bq. make: *** No rule to make target coeffmodnyquist.txt', needed by simulatorGUI.app/Contents/MacOS/coeffmodnyquist.txt'. Stop.

                    Thanks.

                    EDIT:

                    OK, I can see why this wouldn't work. So, can I specify a subdirectory's entire contents as part of the bundle?

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      Yes you can. Just put the path of the subdir into the .files section. That will copy that directory and all its contents and subdirectories into the app bundle.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • mzimmersM Offline
                        mzimmersM Offline
                        mzimmers
                        wrote on last edited by
                        #11

                        Oh, that's pretty slick. Thanks, Volker.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved