Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cf38ed

Browse files
committed
Adjusted .pro files to support Linux and Qt 5.0
1 parent 168f067 commit 1cf38ed

File tree

6 files changed

+61
-2
lines changed

6 files changed

+61
-2
lines changed

IngressLogoGL/GLwindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
*/
99
#include "GLwindow.h"
1010

11+
#include <GL/glu.h>
1112
#include <iostream>
13+
1214
#include <QKeyEvent>
1315
#include <QTimer>
1416

IngressLogoGL/ingress_logo.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
QT += core opengl
22

3+
contains(QT_VERSION, ^5\\.[0-8]\\..*) {
4+
message("* Using Qt $${QT_VERSION}.")
5+
QT += widgets
6+
7+
# On my system I have to specify g++ as compiler else it will use clang++ by default
8+
QMAKE_CXX=g++
9+
QMAKE_CC=gcc
10+
}
11+
12+
unix {
13+
INCLUDEPATH += /usr/X11/include
14+
}
15+
316
SOURCES += \
417
main.cpp \
518
GLwindow.cpp

cvImage/cvImage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void cvImage::_open()
7373
_image = new QImage(img.size().width, img.size().height, QImage::Format_RGB888);
7474

7575
// Copy cv::Mat to QImage
76-
qMemCopy(_image->scanLine(0), (unsigned char*)img.data, _image->width() * _image->height() * img.channels());
76+
memcpy(_image->scanLine(0), (unsigned char*)img.data, _image->width() * _image->height() * img.channels());
7777

7878
// Set the filename as the window title
7979
setWindowTitle(filename);

cvImage/cvImage.pro

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,36 @@ TEMPLATE = app
22

33
QT += core gui
44

5+
contains(QT_VERSION, ^5\\.[0-8]\\..*) {
6+
message("* Using Qt $${QT_VERSION}.")
7+
QT += widgets
8+
9+
# On my system I have to specify g++ as compiler else it will use clang++ by default
10+
#QMAKE_CXX=g++
11+
#QMAKE_CC=gcc
12+
}
13+
514
SOURCES += \
615
main.cpp \
716
cvImage.cpp
817

918
HEADERS += \
1019
cvImage.h
1120

21+
## OpenCV settings for Unix/Linux
22+
unix:!mac {
23+
message("* Using settings for Unix/Linux.")
24+
INCLUDEPATH += /usr/local/include/opencv
25+
26+
LIBS += -L/usr/local/lib/ \
27+
-lopencv_core \
28+
-lopencv_highgui \
29+
-lopencv_imgproc
30+
}
31+
1232
## OpenCV settings for Mac OS X
1333
macx {
34+
message("* Using settings for Mac OS X.")
1435
INCLUDEPATH += /usr/local/include/opencv
1536

1637
LIBS += -L/usr/local/lib/ \
@@ -21,6 +42,7 @@ macx {
2142

2243
## OpenCV settings for Windows and OpenCV 2.4.2
2344
win32 {
45+
message("* Using settings for Windows.")
2446
INCLUDEPATH += "C:\\opencv\\build\\include" \
2547
"C:\\opencv\\build\\include\\opencv" \
2648
"C:\\opencv\\build\\include\\opencv2"

cvVideo/cvVideo.pro

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,36 @@ TEMPLATE = app
22

33
QT += core gui
44

5+
contains(QT_VERSION, ^5\\.[0-8]\\..*) {
6+
message("* Using Qt $${QT_VERSION}.")
7+
QT += widgets
8+
9+
# On my system I have to specify g++ as compiler else it will use clang++ by default
10+
#QMAKE_CXX=g++
11+
#QMAKE_CC=gcc
12+
}
13+
514
HEADERS += \
615
cvWindow.h
716

817
SOURCES += \
918
main.cpp \
1019
cvWindow.cpp
1120

21+
## OpenCV settings for Unix/Linux
22+
unix:!mac {
23+
message("* Using settings for Unix/Linux.")
24+
INCLUDEPATH += /usr/local/include/opencv
25+
26+
LIBS += -L/usr/local/lib/ \
27+
-lopencv_core \
28+
-lopencv_highgui \
29+
-lopencv_imgproc
30+
}
31+
1232
## OpenCV settings for Mac OS X
1333
macx {
34+
message("* Using settings for Mac OS X.")
1435
INCLUDEPATH += /usr/local/include/opencv
1536

1637
LIBS += -L/usr/local/lib/ \
@@ -21,6 +42,7 @@ macx {
2142

2243
## OpenCV settings for Windows and OpenCV 2.4.2
2344
win32 {
45+
message("* Using settings for Windows.")
2446
INCLUDEPATH += "C:\\opencv\\build\\include" \
2547
"C:\\opencv\\build\\include\\opencv" \
2648
"C:\\opencv\\build\\include\\opencv2"

cvVideo/cvWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void cvWindow::_tick()
6161
cv::cvtColor(frame, frame, CV_BGR2RGB);
6262

6363
// Copy cv::Mat to QImage
64-
qMemCopy(_image->scanLine(0), (unsigned char*)frame.data, _image->width() * _image->height() * frame.channels());
64+
memcpy(_image->scanLine(0), (unsigned char*)frame.data, _image->width() * _image->height() * frame.channels());
6565

6666
// The same as above, but much worst.
6767
//QImage img = QImage((uchar*) frame.data, frame.cols, frame.rows, frame.step, QImage::Format_RGB888);

0 commit comments

Comments
 (0)