Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Should *.pro file be part of my project?
Forum Updated to NodeBB v4.3 + New Features

Should *.pro file be part of my project?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.1k Views 2 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.
  • A Offline
    A Offline
    Absurd
    wrote on last edited by Absurd
    #1

    Hey.
    What's the common use with the .pro file that's created by qmake?
    Should I:

    1. Use it once, just to create the Makefile, discard it, and from now on edit the Makefile? (so the *.pro will not be tracked by git)
    2. Maintain it is part of my git repository, and every change I want to do in my Makefile should be originated from the *.pro file (by generating new Makefile from *.pro)?

    I've been doing option 2 above up until now but it has a side effect;
    When I clone my git repository from one server to another and then compile (with 'make') - since the make recognize that the file is new - it regenerates the Makefile from the *.pro file, and by that changing it.

    What's the convention?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Definitely, 100% option 2.

      When I clone my git repository from one server to another and then compile (with 'make')

      You should always run qmake on such new clone, then make.

      Do not store Makefile in git.

      (Z(:^

      A 1 Reply Last reply
      7
      • sierdzioS sierdzio

        Definitely, 100% option 2.

        When I clone my git repository from one server to another and then compile (with 'make')

        You should always run qmake on such new clone, then make.

        Do not store Makefile in git.

        A Offline
        A Offline
        Absurd
        wrote on last edited by
        #3

        @sierdzio Thanks!
        So, git should not track my Makefile, got it.

        How should the build process look like then? Should I have a "build script" that does:

        qmake my_project.pro
        make clean && make

        and the user will execute if they want to build?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          That's not needed. People should rather use out of source builds or will use Qt Creator, just document things properly or point them to the Qt documentation.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          2
          • SGaistS SGaist

            Hi,

            That's not needed. People should rather use out of source builds or will use Qt Creator, just document things properly or point them to the Qt documentation.

            A Offline
            A Offline
            Absurd
            wrote on last edited by
            #5

            Thanks @SGaist.
            "use out of source builds" - you mean use the *.pro file?

            I should have probably mention earlier what I mean when I say "user";
            We have an automated system that builds a project with many (mostly CLI) tools, which are used internally in the company.
            My qt project is a submodule in that project, and I need to give the guy who's in charge of that automated system the set of commands that he need to integrate into his build process in order to produce the ultimate binary which is my qt application.
            For now, we only need that binary for Unix (maybe in the future for Win as well).
            So that's why I was thinking about giving him something along the lines of what I wrote above.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              "out of source" means something like:

              cd ..
              mkdir build
              cd build
              qmake ../source/my_project.pro
              make
              

              It is a build which does not pollute the source directory with any extra files.

              (Z(:^

              1 Reply Last reply
              4
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Usually, automated systems like GitLab provide a mean to write these scripts.

                Does your system provide that ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1

                • Login

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