Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to specify TARGET full path in QMAKE_POST_LINK?

How to specify TARGET full path in QMAKE_POST_LINK?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 739 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.
  • alik_coA Offline
    alik_coA Offline
    alik_co
    wrote on last edited by
    #1

    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
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      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
      3
      • alik_coA Offline
        alik_coA Offline
        alik_co
        wrote on last edited by
        #3

        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
        0

        • Login

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