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. Dollar signs in QMAKE_POST_LINK
Forum Updated to NodeBB v4.3 + New Features

Dollar signs in QMAKE_POST_LINK

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 334 Views 1 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.
  • C Offline
    C Offline
    c.cardona
    wrote on last edited by
    #1

    I have been trying to run a post link command by using the QMAKE_POST_LINK variable, but to no avail. My command contains dollar signs and there is no way to avoid using them; somehow, these are never shown when the command gets printed after building, and the command is never run successfully.

    I have tried escaping the dollar sign with $${LITERAL_DOLLAR} (see this, probably outdated), with just $$, with \$, by declaring a DOLLAR=$ variable and then using it within the command... Nothing works.

    Any ideas?

    SGaistS 1 Reply Last reply
    0
    • C c.cardona

      I have been trying to run a post link command by using the QMAKE_POST_LINK variable, but to no avail. My command contains dollar signs and there is no way to avoid using them; somehow, these are never shown when the command gets printed after building, and the command is never run successfully.

      I have tried escaping the dollar sign with $${LITERAL_DOLLAR} (see this, probably outdated), with just $$, with \$, by declaring a DOLLAR=$ variable and then using it within the command... Nothing works.

      Any ideas?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which version of Qt are you using ?
      On which OS ?
      Can you provide a minimal .pro file that reproduces that ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Which version of Qt are you using ?
        On which OS ?
        Can you provide a minimal .pro file that reproduces that ?

        C Offline
        C Offline
        c.cardona
        wrote on last edited by
        #3

        @SGaist Hi, sorry for the little information I provided, it's my first time posting.

        I am using MacOS 12.5.1 and Qt 5.15.9.

        Here is an example .pro file:

        TARGET = MyApp
        TEMPLATE = app
        
        QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
        SOURCES += src/main.cpp
        
        QMAKE_POST_LINK = echo "This is shown"
        QMAKE_POST_LINK += && cat $(echo "~/thisWillNotShow.txt")
        

        The first line (echo "This is shown") will execute, but the second will only execute cat and stop as soon as it sees the $. The QMAKE_POST_LINK command that qmake shows it is executing is indeed just echo This is shown && cat.

        SGaistS 1 Reply Last reply
        0
        • C c.cardona

          @SGaist Hi, sorry for the little information I provided, it's my first time posting.

          I am using MacOS 12.5.1 and Qt 5.15.9.

          Here is an example .pro file:

          TARGET = MyApp
          TEMPLATE = app
          
          QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
          SOURCES += src/main.cpp
          
          QMAKE_POST_LINK = echo "This is shown"
          QMAKE_POST_LINK += && cat $(echo "~/thisWillNotShow.txt")
          

          The first line (echo "This is shown") will execute, but the second will only execute cat and stop as soon as it sees the $. The QMAKE_POST_LINK command that qmake shows it is executing is indeed just echo This is shown && cat.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I don't have an answer yet with regard to the dollar issue but in the meantime, would using backticks around the command be a workaround you can use ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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