Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
f856f78a
Commit
f856f78a
authored
Apr 17, 2013
by
Andrey Kamaev
Committed by
Andrey Pavlenko
May 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CMake scripts to recognize Qt 5.0
parent
9cce8ca4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
CMakeLists.txt
CMakeLists.txt
+5
-2
OpenCVFindLibsGUI.cmake
cmake/OpenCVFindLibsGUI.cmake
+24
-5
CMakeLists.txt
modules/highgui/CMakeLists.txt
+20
-1
window_QT.h
modules/highgui/src/window_QT.h
+4
-4
No files found.
CMakeLists.txt
View file @
f856f78a
...
...
@@ -594,12 +594,15 @@ endif()
status
(
""
)
status
(
" GUI: "
)
if
(
HAVE_QT
)
if
(
HAVE_QT5
)
status
(
" QT 5.x:"
HAVE_QT THEN
"YES (ver
${
Qt5Core_VERSION_STRING
}
)"
ELSE NO
)
status
(
" QT OpenGL support:"
HAVE_QT_OPENGL THEN
"YES (
${
Qt5OpenGL_LIBRARIES
}
${
Qt5OpenGL_VERSION_STRING
}
)"
ELSE NO
)
elseif
(
HAVE_QT
)
status
(
" QT 4.x:"
HAVE_QT THEN
"YES (ver
${
QT_VERSION_MAJOR
}
.
${
QT_VERSION_MINOR
}
.
${
QT_VERSION_PATCH
}
${
QT_EDITION
}
)"
ELSE NO
)
status
(
" QT OpenGL support:"
HAVE_QT_OPENGL THEN
"YES (
${
QT_QTOPENGL_LIBRARY
}
)"
ELSE NO
)
else
()
if
(
DEFINED WITH_QT
)
status
(
" QT
4.x
:"
NO
)
status
(
" QT:"
NO
)
endif
()
if
(
DEFINED WITH_WIN32UI
)
status
(
" Win32 UI:"
HAVE_WIN32UI THEN YES ELSE NO
)
...
...
cmake/OpenCVFindLibsGUI.cmake
View file @
f856f78a
...
...
@@ -13,12 +13,31 @@ if(WITH_WIN32UI)
endif
(
WITH_WIN32UI
)
# --- QT4 ---
ocv_clear_vars
(
HAVE_QT
)
ocv_clear_vars
(
HAVE_QT
HAVE_QT5
)
if
(
WITH_QT
)
find_package
(
Qt4
)
if
(
QT4_FOUND
)
set
(
HAVE_QT TRUE
)
add_definitions
(
-DHAVE_QT
)
# We need to define the macro this way, using cvconfig.h does not work
if
(
NOT CMAKE_VERSION VERSION_LESS 2.8.3 AND NOT WITH_QT EQUAL 4
)
find_package
(
Qt5Core
)
find_package
(
Qt5Gui
)
find_package
(
Qt5Widgets
)
find_package
(
Qt5Test
)
find_package
(
Qt5Concurrent
)
if
(
Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND AND Qt5Concurrent_FOUND
)
set
(
HAVE_QT5 ON
)
set
(
HAVE_QT ON
)
add_definitions
(
-DHAVE_QT
)
find_package
(
Qt5OpenGL
)
if
(
Qt5OpenGL_FOUND
)
set
(
QT_QTOPENGL_FOUND ON
)
endif
()
endif
()
endif
()
if
(
NOT HAVE_QT
)
find_package
(
Qt4
)
if
(
QT4_FOUND
)
set
(
HAVE_QT TRUE
)
add_definitions
(
-DHAVE_QT
)
# We need to define the macro this way, using cvconfig.h does not work
endif
()
endif
()
endif
()
...
...
modules/highgui/CMakeLists.txt
View file @
f856f78a
...
...
@@ -70,7 +70,26 @@ set(highgui_srcs
file
(
GLOB highgui_ext_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
if
(
HAVE_QT
)
if
(
HAVE_QT5
)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_INCLUDE_CURRENT_DIR ON
)
QT5_ADD_RESOURCES
(
_RCC_OUTFILES src/window_QT.qrc
)
list
(
APPEND highgui_srcs src/window_QT.cpp src/window_QT.h
${
_RCC_OUTFILES
}
)
foreach
(
dt5_dep Core Gui Widgets Test Concurrent
)
add_definitions
(
${
Qt5
${
dt5_dep
}
_DEFINITIONS
}
)
include_directories
(
${
Qt5
${
dt5_dep
}
_INCLUDE_DIRS
}
)
list
(
APPEND HIGHGUI_LIBRARIES
${
Qt5
${
dt5_dep
}
_LIBRARIES
}
)
endforeach
()
if
(
HAVE_QT_OPENGL
)
add_definitions
(
${
Qt5OpenGL_DEFINITIONS
}
)
include_directories
(
${
Qt5OpenGL_INCLUDE_DIRS
}
)
list
(
APPEND HIGHGUI_LIBRARIES
${
Qt5OpenGL_LIBRARIES
}
)
endif
()
elseif
(
HAVE_QT
)
if
(
HAVE_QT_OPENGL
)
set
(
QT_USE_QTOPENGL TRUE
)
endif
()
...
...
modules/highgui/src/window_QT.h
View file @
f856f78a
...
...
@@ -48,13 +48,13 @@
#endif
#include <QAbstractEventDispatcher>
#include <Q
tGui/Q
Application>
#include <QApplication>
#include <QFile>
#include <QPushButton>
#include <Q
tGui/Q
GraphicsView>
#include <QGraphicsView>
#include <QSizePolicy>
#include <QInputDialog>
#include <Q
tGui/Q
BoxLayout>
#include <QBoxLayout>
#include <QSettings>
#include <qtimer.h>
#include <QtConcurrentRun>
...
...
@@ -78,7 +78,7 @@
#include <QRadioButton>
#include <QButtonGroup>
#include <QMenu>
#include <Q
tTest/Q
Test>
#include <QTest>
//start private enum
enum
{
CV_MODE_NORMAL
=
0
,
CV_MODE_OPENGL
=
1
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment