Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QMAKE_EXTRA_TARGETS and QtCreator

    General and Desktop
    2
    5
    917
    Loading More Posts
    • 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
      chopper last edited by

      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_1980 1 Reply Last reply Reply Quote 0
      • C
        chopper last edited by

        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 Reply Quote 0
        • aha_1980
          aha_1980 Lifetime Qt Champion @chopper last edited by

          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 Reply Quote 0
          • C
            chopper @aha_1980 last edited by

            @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_1980 1 Reply Last reply Reply Quote 0
            • aha_1980
              aha_1980 Lifetime Qt Champion @chopper last edited by

              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 Reply Quote 0
              • First post
                Last post