Dollar signs in QMAKE_POST_LINK
-
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?
-
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?
Hi and welcome to devnet,
Which version of Qt are you using ?
On which OS ?
Can you provide a minimal.profile that reproduces that ? -
Hi and welcome to devnet,
Which version of Qt are you using ?
On which OS ?
Can you provide a minimal.profile that reproduces that ?@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
.profile: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 executecatand stop as soon as it sees the$. TheQMAKE_POST_LINKcommand thatqmakeshows it is executing is indeed justecho This is shown && cat. -
@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
.profile: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 executecatand stop as soon as it sees the$. TheQMAKE_POST_LINKcommand thatqmakeshows it is executing is indeed justecho This is shown && cat.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 ?