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. QMAKE_EXTRA_TARGETS and QtCreator
QtWS25 Last Chance

QMAKE_EXTRA_TARGETS and QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.5k Views
  • 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.
  • C Offline
    C Offline
    chopper
    wrote on last edited by
    #1

    I'm trying to package up a folder of includes and libs after my static library builds - and I don't want to use the INSTALL system of qmake (for several reasons) - so I created a small edition to my libraries PRO file, based upon documentation surrounding 'adding custom targets' - and I don't seem to be getting anywhere.

    I can see the target is being written by qmake into the Makefiles, but my understanding is that by adding the target via QMAKE_EXTRA_TARGETS would add this as a target to all build targets.

    Is that incorrect?

    Thanks :)

    # On Windows we want static libraries and a folder of includes
    
    win32: {
        package_includes.target = $$PWD/build/Windows/includes
        package_includes.commands = mkdir $$package_includes.target
        package_includes.depends = package_sdk
    
        package_sdk.commands = @echo Packaging the SDK - creating includes directory at $$package_includes.target
    
        QMAKE_EXTRA_TARGETS += package_includes package_sdk
    }
    
    aha_1980A 1 Reply Last reply
    0
    • C Offline
      C Offline
      chopper
      wrote on last edited by
      #2

      BTW, I'm working around it for now using:

      QMAKE_POST_LINK += call package_windows.cmd
      

      And just putting packaging logic in there.

      1 Reply Last reply
      0
      • C chopper

        I'm trying to package up a folder of includes and libs after my static library builds - and I don't want to use the INSTALL system of qmake (for several reasons) - so I created a small edition to my libraries PRO file, based upon documentation surrounding 'adding custom targets' - and I don't seem to be getting anywhere.

        I can see the target is being written by qmake into the Makefiles, but my understanding is that by adding the target via QMAKE_EXTRA_TARGETS would add this as a target to all build targets.

        Is that incorrect?

        Thanks :)

        # On Windows we want static libraries and a folder of includes
        
        win32: {
            package_includes.target = $$PWD/build/Windows/includes
            package_includes.commands = mkdir $$package_includes.target
            package_includes.depends = package_sdk
        
            package_sdk.commands = @echo Packaging the SDK - creating includes directory at $$package_includes.target
        
            QMAKE_EXTRA_TARGETS += package_includes package_sdk
        }
        
        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi @chopper said in QMAKE_EXTRA_TARGETS and QtCreator:

        I can see the target is being written by qmake into the Makefiles, but my understanding is that by adding the target via QMAKE_EXTRA_TARGETS would add this as a target to all build targets.

        My qmake knowledge is still limited, but I guess that these extra targets are not called automatically. You should be able, however, to call make package_sdk after the build and then it should work...

        Qt has to stay free or it will die.

        C 1 Reply Last reply
        0
        • aha_1980A aha_1980

          Hi @chopper said in QMAKE_EXTRA_TARGETS and QtCreator:

          I can see the target is being written by qmake into the Makefiles, but my understanding is that by adding the target via QMAKE_EXTRA_TARGETS would add this as a target to all build targets.

          My qmake knowledge is still limited, but I guess that these extra targets are not called automatically. You should be able, however, to call make package_sdk after the build and then it should work...

          C Offline
          C Offline
          chopper
          wrote on last edited by
          #4

          @aha_1980 That's what seems to be happening, but that's not the way the examples I've read state it operates.
          It's more flexible to simply script my custom stuff outside of qmake anyhow.

          Thanks

          aha_1980A 1 Reply Last reply
          0
          • C chopper

            @aha_1980 That's what seems to be happening, but that's not the way the examples I've read state it operates.
            It's more flexible to simply script my custom stuff outside of qmake anyhow.

            Thanks

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi @chopper,

            so if you found your solution, please mark this topic as SOLVED now. Thanks!

            Qt has to stay free or it will die.

            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