1

I want to include multiple paths in the Qt .pro file. For example, there are three opencv paths to be included in the file:

C:/opencv-3.2.0/mybuild/include
C:/opencv-3.2.0/mybuild/include/opencv
C:/opencv-3.2.0/mybuild/include/opencv2

I have tried (refer to: INCLUDEPATH):

INCLUDEPATH = "C:/opencv-3.2.0/mybuild/include" "C:/opencv-3.2.0/mybuild/include/opencv" "C:/opencv-3.2.0/mybuild/include/opencv2"

This puts the three paths quoted and separated by one blank, which seems valid in Qt, but too lengthy for a single line. Is there any other simpler format?

Apart from the path include, I also need to include different types of libraries, some for opencv and other for 1394camera. What I are now doing is:

CONFIG(release, debug|release): LIBS += -L"C:/Program Files (x86)/CMU/1394Camera/lib64/x64" -l1394camera -luser32 -L"C:/opencv-3.2.0/mybuild/x64/vc14/lib" -lopencv_core320 -lopencv_imgproc320 -lopencv_highgui320 

This also puts all the libraries in a single line.

jwm
  • 4,832
  • 10
  • 46
  • 78
  • Use `CONFIG(release, debug|release): LIBS += -L"C:/Program Files \(x86)/CMU/1394Camera/lib64/x64" \ -l1394camera \ -luser32 -L"C:/opencv-3.2.0/mybuild/x64/vc14/lib" \ -lopencv_core320 \ -lopencv_imgproc320 \ -lopencv_highgui320` ` – eyllanesc Feb 08 '18 at 16:00
  • Can '\' allow to put them in multiple lines? – jwm Feb 08 '18 at 16:03
  • yes.......................... – eyllanesc Feb 08 '18 at 16:03
  • @eyllanesc I have got an error: Extra characters after test expression. – jwm Feb 08 '18 at 16:33

1 Answers1

2
INCLUDEPATH += C:/opencv-3.2.0/mybuild/include
INCLUDEPATH += C:/opencv-3.2.0/mybuild/include/opencv
INCLUDEPATH += C:/opencv-3.2.0/mybuild/include/opencv2

or

INCLUDEPATH += C:/opencv-3.2.0/mybuild/include \
               C:/opencv-3.2.0/mybuild/include/opencv \
               C:/opencv-3.2.0/mybuild/include/opencv2

Please not the += operator, to preserve already set paths.

p-a-o-l-o
  • 9,807
  • 2
  • 22
  • 35