2

When using qmake to create a project on Windows 7 (using Visual Studio 2010):

qmake -tp vc OmniScribe.pro 

In my .pro file I have (among many other things) under INCLUDEPATH=+

${OPENCV_HOME}/include/opencv \ 

But when I view Project Settings -> C/C++ -> General -> Additional Include Directories, in the listing, I see that this OPENCV_HOME environment variable has not been replaced and the following is contained in the list there:

${OPENCV_HOME}\include\opencv 

I definitely have an OPENCV_HOME set as part of my user environment variables as:

X:\users\username\Windows_Stuff\OpenCV2.4 

Note this is a network drive on a machine I do not have administrator rights with.

How can I configure my .pro file or change my qmake command to not have this happen? The above syntax is parsed correctly when using Linux so I am unsure what I need to do to fix things or where the root problem is lying.

1 Answer 1

2

To expand environment variables at the time qmake is run use: $$(OPENCV_HOME)

Sign up to request clarification or add additional context in comments.

1 Comment

This is part of the solution - on Linux the ${var_name} syntax technically works because it is how Linux references environment variables, which means you can use "incorrect" syntax but get away with it. Windows does not use ${varname} and so it will not work there.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.