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. How to differentiate different compiling options
Forum Updated to NodeBB v4.3 + New Features

How to differentiate different compiling options

Scheduled Pinned Locked Moved Solved General and Desktop
pro extension
10 Posts 3 Posters 2.0k 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.
  • R Offline
    R Offline
    rintec
    wrote on last edited by
    #1

    I just knew we can do this by giving different extensions to the .pro file. For example,
    we may give .pro file the extension Qt5_4_0 or Qt5_3_0 to differentiate different Qt SDK versions, thus the names of the project files may ${PROJECT}.pro.Qt5_4_0 or ${PROJECT}.pro.Qt5_3_0. Then what is the macro name to define the extensions as an environement variable, thx a lot!

    1 Reply Last reply
    0
    • jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Usually you just use different kits with different compiler/Qt/.. to build for different Qt versions.
      I don't see any need to have several PRO files.

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

      R 1 Reply Last reply
      0
      • ? Guest
        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @andreank How is this related to the original post?

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

        1 Reply Last reply
        0
        • jsulmJ jsulm

          Usually you just use different kits with different compiler/Qt/.. to build for different Qt versions.
          I don't see any need to have several PRO files.

          R Offline
          R Offline
          rintec
          wrote on last edited by
          #4

          @jsulm for example, i want to compile for the targets both of windows and android based on the same suite of source code, how can i handle two .pro files?

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

            @jsulm It wasn't at all, just a spam for an unhealthy website so removed.

            @rintec you can use the same .pro file.

            If you need something specific you can use e.g. scopes:

            android {
                DEFINES += MY_ANDROID_STUFF
            }
            
            win32 {
                SOURCES += my_win32_code.cpp
            }
            

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

            R 2 Replies Last reply
            1
            • SGaistS SGaist

              @jsulm It wasn't at all, just a spam for an unhealthy website so removed.

              @rintec you can use the same .pro file.

              If you need something specific you can use e.g. scopes:

              android {
                  DEFINES += MY_ANDROID_STUFF
              }
              
              win32 {
                  SOURCES += my_win32_code.cpp
              }
              
              R Offline
              R Offline
              rintec
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • SGaistS SGaist

                @jsulm It wasn't at all, just a spam for an unhealthy website so removed.

                @rintec you can use the same .pro file.

                If you need something specific you can use e.g. scopes:

                android {
                    DEFINES += MY_ANDROID_STUFF
                }
                
                win32 {
                    SOURCES += my_win32_code.cpp
                }
                
                R Offline
                R Offline
                rintec
                wrote on last edited by
                #7

                @SGaist ok, thx, while there may be another scenario: two developer work on the same suite of source codes on two different platforms, for example, windows and linux. they want to upload and share the project to the same git respository for further sharing or restore, then how can we differentiate the same .pro file name but with two different content due to different platforms and compiling environments.

                @SGaist said:

                @jsulm It wasn't at all, just a spam for an unhealthy website so removed.

                @rintec you can use the same .pro file.

                If you need something specific you can use e.g. scopes:

                android {
                    DEFINES += MY_ANDROID_STUFF
                }
                
                win32 {
                    SOURCES += my_win32_code.cpp
                }
                
                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rintec
                  wrote on last edited by
                  #8

                  OK, thx everyone, I have just found the answer. It's the macro QTC_EXTENSION. which may change the extension of .pro.user, that is, .user, to everything you want!

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

                    Again: you don't need to do that. Just use the same .pro file with scopes. You may have to occasionally do some merging by hand but with a proper source control system it's not a problem.

                    The .pro.user files are tied to the machine you are running Qt Creator on. You can keep some common configs in a .pro.shared file but the .pro.user should not be commit to source control.

                    Also, if they have to work on feature for specific OSs, they should do so in their own branch and once that's done, everything should be merged back to master.

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

                    R 1 Reply Last reply
                    1
                    • SGaistS SGaist

                      Again: you don't need to do that. Just use the same .pro file with scopes. You may have to occasionally do some merging by hand but with a proper source control system it's not a problem.

                      The .pro.user files are tied to the machine you are running Qt Creator on. You can keep some common configs in a .pro.shared file but the .pro.user should not be commit to source control.

                      Also, if they have to work on feature for specific OSs, they should do so in their own branch and once that's done, everything should be merged back to master.

                      R Offline
                      R Offline
                      rintec
                      wrote on last edited by
                      #10

                      @SGaist ok, thx a lot!

                      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