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. can i detect "Edit build configuration" in the .pro file?
Forum Updated to NodeBB v4.3 + New Features

can i detect "Edit build configuration" in the .pro file?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 307 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    My "edit build configuration" menu looks like this:

    configs.png

    Can i detect the contents of the currently selected menu item in my .pro file?

    (by the way, is the ".pro" file actually a "qmake" file? if so, why not have the extension be ".qmake" ? but i digress)

    I'd like to have different #defines based on that menu, eg: i'd like to do something like this in the .pro file:

    contains (build_config, "Pro") {
         DEFINES += KJAMS_PRO
    }
    
    contains (build_config, "2") {
         DEFINES += KJAMS_2
    }
    

    but how?

    kshegunovK 1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #7

      oh, i see, i did this:

      Screen Shot 2021-05-30 at 11.36.33 AM.png
      so it LOOKS LIKE i've already set this up for myself! hah!

      1 Reply Last reply
      2
      • D davecotter

        My "edit build configuration" menu looks like this:

        configs.png

        Can i detect the contents of the currently selected menu item in my .pro file?

        (by the way, is the ".pro" file actually a "qmake" file? if so, why not have the extension be ".qmake" ? but i digress)

        I'd like to have different #defines based on that menu, eg: i'd like to do something like this in the .pro file:

        contains (build_config, "Pro") {
             DEFINES += KJAMS_PRO
        }
        
        contains (build_config, "2") {
             DEFINES += KJAMS_2
        }
        

        but how?

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by kshegunov
        #2

        @davecotter said in can i detect "Edit build configuration" in the .pro file?:

        Can i detect the contents of the currently selected menu item in my .pro file?

        No.

        by the way, is the ".pro" file actually a "qmake" file?

        Yes, it is.

        I'd like to have different #defines based on that menu, eg: i'd like to do something like this in the .pro file

        You can. Then you'd run qmake on the project from the command line and instead of configuring it inside the creator you'd do an "Import build" from the "Configure project" pane.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by davecotter
          #3

          that's precisely what i wish to avoid.

          i want to select the config (menu, lower left), and hit "build" (in the IDE) and have that be that. sounds like it can't happen?

          Screen Shot 2021-05-24 at 4.16.26 PM.png

          kshegunovK 1 Reply Last reply
          0
          • D davecotter

            that's precisely what i wish to avoid.

            i want to select the config (menu, lower left), and hit "build" (in the IDE) and have that be that. sounds like it can't happen?

            Screen Shot 2021-05-24 at 4.16.26 PM.png

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #4

            @davecotter said in can i detect "Edit build configuration" in the .pro file?:

            i want to select the config (menu, lower left), and hit "build" (in the IDE) and have that be that. sounds like it can't happen?

            Not that I know of.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #5

              so, umm, well i put this in my qmake file:

              message($${TARGET} $${build_depth}bit)

              and the result is this:

              Project MESSAGE: kJams 2 Debug 64bit

              so it seems that i AM able to detect the current target. Does this seem surprising to you?

              kshegunovK 1 Reply Last reply
              0
              • D davecotter

                so, umm, well i put this in my qmake file:

                message($${TARGET} $${build_depth}bit)

                and the result is this:

                Project MESSAGE: kJams 2 Debug 64bit

                so it seems that i AM able to detect the current target. Does this seem surprising to you?

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #6

                @davecotter said in can i detect "Edit build configuration" in the .pro file?:

                Does this seem surprising to you?

                Very. Never seen that.

                Edit:
                Does this mean that Creator overwrites TARGET in the .pro file?

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by
                  #7

                  oh, i see, i did this:

                  Screen Shot 2021-05-30 at 11.36.33 AM.png
                  so it LOOKS LIKE i've already set this up for myself! hah!

                  1 Reply Last reply
                  2

                  • Login

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