0

I'm trying to build a qt project which will use boost binary libraries. And I want path to libs to be passed from .sh script to qmake and extended in .pro file. So I have this .pro file:

TEMPLATE = app
CONFIG += console
CONFIG -= qt

SOURCES += main.cpp

message("Master pro file path : ["$$[BOOST_LIBS_PATH]"]")

LIBS += -L$$[BOOST_LIBS_PATH]

and a script file that run qmake:

BOOST_LIBS_PATH=/path/to/boost

echo $BOOST_LIBS_PATH

qmake-qt4 qt_test_proj.pro -r -spec linux-g++

but at the complie output I receive

Project MESSAGE: boost libs path : []

so BOOST_LIBS_PATH in .pro file is still empty.

Waqar
  • 8,558
  • 4
  • 35
  • 43
kopalvich
  • 434
  • 5
  • 14

1 Answers1

2

I think you can pass the path with an environment variable, but you do not set any. I would do it in the following way.

In the script file

export BOOST_LIBS_PATH="/path/to/boost"
echo $BOOST_LIBS_PATH

Qt docs say that

To obtain the contents of an environment value at the time when the generated Makefile is processed, use the $(...) operator.

So in the project file

# Note the usage of $() operator.
message("Master pro file path : ["$(BOOST_LIBS_PATH)"]")
[..]
LIBS += -L$(BOOST_LIBS_PATH])
vahancho
  • 20,808
  • 3
  • 47
  • 55