Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to generate .pro.user from command line?
Forum Updated to NodeBB v4.3 + New Features

How to generate .pro.user from command line?

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 3 Posters 1.7k 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.
  • T Offline
    T Offline
    Tom asso
    wrote on 27 Apr 2020, 17:51 last edited by
    #1

    I have a .pro file, and I want to generate an accompanying .pro.user file, without using qtcreator. Is there a way to generate the .pro.user file using 'qmake'? qmake with no options generates a Makfile from the .pro file, but the generated Makefile doesn't contain the 'moc' commands to build the moc_* files. I haven't been able to find a qmake option that will do this...

    Thanks!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Apr 2020, 18:10 last edited by
      #2

      Hi,

      No, that file is Qt Creator specific an contains only information that pertains to Qt Creator.

      It has nothing to do with generating moc files.

      What is your exact issue ?

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

      T 1 Reply Last reply 27 Apr 2020, 18:49
      1
      • S SGaist
        27 Apr 2020, 18:10

        Hi,

        No, that file is Qt Creator specific an contains only information that pertains to Qt Creator.

        It has nothing to do with generating moc files.

        What is your exact issue ?

        T Offline
        T Offline
        Tom asso
        wrote on 27 Apr 2020, 18:49 last edited by
        #3

        @SGaist - I want to build a Qt project using only command line tools, without the need to use qtcreator. This is proving to be a real struggle for me. First I developed my app with qtcreator and qmake - it builds fine. Now to test building without qtcreator I've copied my .cpp, .h, .qml, qml.qrc and .pro files to a separate directory. In that directory I type 'qmake' to generate a Makefile, but the project does not properly build. Comparing the Makefiles generated in the original (qtcreator) directory and the test (qmake-only) directory, there are many differences. In particular the original Makefile includes '-I /usr/local/include' in its compilation flags, but the test directory Makefile does not - one reason why building in the test directory fails.
        I assume I have not copied some file needed by qmake to build a working Makefile, but what?
        Thanks

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 27 Apr 2020, 18:50 last edited by
          #4

          Are you sure you are using the same qmake executable ?
          A recommandation is to always use the full path to the executable.

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

          T 1 Reply Last reply 27 Apr 2020, 18:52
          1
          • S SGaist
            27 Apr 2020, 18:50

            Are you sure you are using the same qmake executable ?
            A recommandation is to always use the full path to the executable.

            T Offline
            T Offline
            Tom asso
            wrote on 27 Apr 2020, 18:52 last edited by Tom asso
            #5

            @SGaist - Yes, 'which qmake' shows I am using the same qmake in both cases.
            Looking for a clue, I opened qtcreator in the test directory, and get this error message:

            All settings files found in directory "/home/oreilly/projects/mb-system/MB-System/src/qttest/mbgrdviz-2.pro.user" were unsuitable for the current version of Qt Creator, for instance because they were written by an incompatible version of Qt Creator, or because a different settings path was used.
            

            So, why does qtcreator give this warning? I don't understand how it "knows" a different settings path was used. I am thinking this is one cause of my problem...

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 27 Apr 2020, 18:55 last edited by
              #6

              What errors are you getting ?

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

              T 1 Reply Last reply 27 Apr 2020, 18:59
              0
              • S SGaist
                27 Apr 2020, 18:55

                What errors are you getting ?

                T Offline
                T Offline
                Tom asso
                wrote on 27 Apr 2020, 18:59 last edited by
                #7

                @SGaist - The Makefile generated by qmake in the test directory does not include /usr/local/include in its compilation flags, whereas the qmake-generated Makefile in the original directory does. So the compiler cannot find headers in /usr/local/include.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 27 Apr 2020, 19:02 last edited by
                  #8

                  That's typically a folder that you should add to the INCLUDEPATH variable in your .pro file.

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

                  T 1 Reply Last reply 27 Apr 2020, 23:31
                  0
                  • S SGaist
                    27 Apr 2020, 19:02

                    That's typically a folder that you should add to the INCLUDEPATH variable in your .pro file.

                    T Offline
                    T Offline
                    Tom asso
                    wrote on 27 Apr 2020, 23:31 last edited by
                    #9

                    @SGaist - Thanks! How do I specify that "system" include directory in a platform-neutral way in the .pro file?

                    J 1 Reply Last reply 28 Apr 2020, 04:49
                    0
                    • T Tom asso
                      27 Apr 2020, 23:31

                      @SGaist - Thanks! How do I specify that "system" include directory in a platform-neutral way in the .pro file?

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 28 Apr 2020, 04:49 last edited by
                      #10

                      @Tom-asso Like shown in documentation: https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      T 1 Reply Last reply 28 Apr 2020, 16:19
                      1
                      • J jsulm
                        28 Apr 2020, 04:49

                        @Tom-asso Like shown in documentation: https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                        T Offline
                        T Offline
                        Tom asso
                        wrote on 28 Apr 2020, 16:19 last edited by
                        #11

                        @jsulm - I see, thank you @jsulm and @SGaist !

                        1 Reply Last reply
                        0

                        1/11

                        27 Apr 2020, 17:51

                        • Login

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