Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to specify TARGET full path in QMAKE_POST_LINK?

    Tools
    2
    3
    450
    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.
    • alik_co
      alik_co last edited by

      To run post-processing tool with QMAKE_POST_LINK, I need to specify full path to the target file. The best I can do so far is

      QMAKE_POST_LINK = Post-Process-Tool "$${DESTDIR}/$${TARGET}.exe"
      

      but I'm looking for generalized solution (output file can have different extensions)
      Thanks in advance,

      1 Reply Last reply Reply Quote 0
      • Paul Colby
        Paul Colby last edited by

        Not sure if this is the best solution, but it might be enough for you:

        QMAKE_POST_LINK = Post-Process-Tool $$shell_quote($${DESTDIR}/$${TARGET}$$join(TARGET_EXT,,.))
        

        Here I've used $$join so that the . separator only appears if the file extension is non-empty.

        Also $$shell_quote may or may not be necessary if the path contains spaces, etc.

        Cheers.

        1 Reply Last reply Reply Quote 3
        • alik_co
          alik_co last edited by

          Unfortunately the above solution didn't work for me, $${TARGET_EXT} appears empty.

          BTW, the entire concept of building full path to the output file "by hand" appears to be limited. For instance, with TARGET=MyModule and TEMPLATE=lib, the output file is MyModule.dll on Windows but libMyModule.so.1.0.0 on Linux, so simple concatenation just doesn't work.

          It has to be a better way to pickup complete full path to the target file. QMAKE_RESOLVED_TARGET from mkspecs/features/resolve_target.prf seems to be a good candidate, but I'm failing to extract its value: it appears empty when I try to use it in QMAKE_POST_LINK.

          Qt community, please advise. Inability to specify arguments for post link step becomes a (very unexpected) shortcoming of qmake system and blocks our entire project.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post