[Qt-creator] How *not* hard-code Qt Project Build Environment variable LD_LIBRARY_PATH ?
Ed Sutton
ESutton at fescorp.com
Tue Mar 30 17:36:35 CEST 2010
Sorry, I am stuck on this...
When it comes to dynamically loaded shared libs that are required at link time, I can not figure out the trick of completely removing hard-coded paths from my Qt Creator project build environment. Setting LD_LIBRARY_PATH under the Qt Project Build Environment to a relative path works fine for building / linking. Example:
LD_LIBRARY_PATH=/opt/qtsdk-2010.02/lib/qtcreator:/home/esutton/projects/myproject/guiproject/../../lib
Question: How can I replace the base part of the relative path with a variable?
Replacing with $(PWD), does not work. Apparently at the build environment stage, PWD is set to the qmake working directory of "/opt/qtsdk-2010.02/qt/bin"
LD_LIBRARY_PATH=/opt/qtsdk-2010.02/lib/qtcreator:$(PWD)/../../lib
Can a variable added to the Qt project file be referenced in the Qt project Build Environment ?
I tried adding this to my Qt Project File:
MYLDLIBPATH = $$PWD/../../lib
message(MYLDLIBPATH == $$MYLDLIBPATH)
and adding a reference to this variable in the Qt project Build Environment:
LD_LIBRARY_PATH=/opt/qtsdk-2010.02/lib/qtcreator:$(MYLDLIBPATH)
This does *not* work even though the qmake message displays the desired path:
Project MESSAGE: MYLDLIBPATH = /home/esutton/projects/myproject/guiproject/../../lib
I am building under Red Hat Enterprise Linux 5.x. I do not want to use rpath because I want to avoid hard-coded paths in released binaries. My goal is to retrieve source code from the repository and to build a release using:
qmake myproject.pro
make
-Ed
More information about the Qt-creator-old
mailing list