2012-05-30 17:00:32 +08:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Detect 3rd-party GUI libraries
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2013-03-27 23:03:51 +08:00
|
|
|
#--- Win32 UI ---
|
|
|
|
ocv_clear_vars(HAVE_WIN32UI)
|
|
|
|
if(WITH_WIN32UI)
|
2013-08-22 19:46:13 +08:00
|
|
|
try_compile(HAVE_WIN32UI
|
|
|
|
"${OpenCV_BINARY_DIR}"
|
2013-03-27 23:03:51 +08:00
|
|
|
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
|
2013-08-22 19:46:13 +08:00
|
|
|
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=user32;gdi32")
|
|
|
|
endif()
|
2013-03-27 23:03:51 +08:00
|
|
|
|
2012-05-30 17:00:32 +08:00
|
|
|
# --- QT4 ---
|
2013-04-18 02:02:01 +08:00
|
|
|
ocv_clear_vars(HAVE_QT HAVE_QT5)
|
2012-05-30 17:00:32 +08:00
|
|
|
if(WITH_QT)
|
2013-07-22 17:55:49 +08:00
|
|
|
if(NOT WITH_QT EQUAL 4)
|
2019-04-25 02:36:29 +08:00
|
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets Test Concurrent REQUIRED NO_MODULE)
|
|
|
|
if(Qt5_FOUND)
|
2013-04-18 02:02:01 +08:00
|
|
|
set(HAVE_QT5 ON)
|
|
|
|
set(HAVE_QT ON)
|
2019-04-25 02:36:29 +08:00
|
|
|
find_package(Qt5 COMPONENTS OpenGL QUIET)
|
2013-04-18 02:02:01 +08:00
|
|
|
if(Qt5OpenGL_FOUND)
|
|
|
|
set(QT_QTOPENGL_FOUND ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_QT)
|
2013-06-06 18:09:33 +08:00
|
|
|
find_package(Qt4 REQUIRED QtCore QtGui QtTest)
|
2013-04-18 02:02:01 +08:00
|
|
|
if(QT4_FOUND)
|
|
|
|
set(HAVE_QT TRUE)
|
|
|
|
endif()
|
2012-05-30 17:00:32 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- GTK ---
|
2013-10-03 04:16:40 +08:00
|
|
|
ocv_clear_vars(HAVE_GTK HAVE_GTK3 HAVE_GTHREAD HAVE_GTKGLEXT)
|
2012-05-30 17:00:32 +08:00
|
|
|
if(WITH_GTK AND NOT HAVE_QT)
|
2014-04-02 06:01:18 +08:00
|
|
|
if(NOT WITH_GTK_2_X)
|
2019-04-16 05:29:17 +08:00
|
|
|
ocv_check_modules(GTK3 gtk+-3.0)
|
2014-04-13 05:43:42 +08:00
|
|
|
if(HAVE_GTK3)
|
2019-04-16 05:29:17 +08:00
|
|
|
ocv_append_build_options(HIGHGUI GTK3)
|
2014-04-13 05:43:42 +08:00
|
|
|
set(HAVE_GTK TRUE)
|
|
|
|
endif()
|
2014-04-11 06:28:23 +08:00
|
|
|
endif()
|
|
|
|
if(NOT HAVE_GTK)
|
2019-04-16 05:29:17 +08:00
|
|
|
ocv_check_modules(GTK2 gtk+-2.0)
|
|
|
|
if(HAVE_GTK2)
|
|
|
|
if (GTK2_VERSION VERSION_LESS MIN_VER_GTK)
|
|
|
|
message (FATAL_ERROR "GTK support requires a minimum version of ${MIN_VER_GTK} (${GTK2_VERSION} found)")
|
|
|
|
else()
|
|
|
|
ocv_append_build_options(HIGHGUI GTK2)
|
|
|
|
set(HAVE_GTK TRUE)
|
|
|
|
endif()
|
2013-11-27 05:35:03 +08:00
|
|
|
endif()
|
2013-10-03 04:16:40 +08:00
|
|
|
endif()
|
2019-04-16 05:29:17 +08:00
|
|
|
ocv_check_modules(GTHREAD gthread-2.0)
|
2014-04-10 05:07:59 +08:00
|
|
|
if(HAVE_GTK AND NOT HAVE_GTHREAD)
|
2014-04-01 05:05:09 +08:00
|
|
|
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
|
2019-04-16 05:29:17 +08:00
|
|
|
else()
|
|
|
|
ocv_append_build_options(HIGHGUI GTHREAD)
|
2013-11-27 05:35:03 +08:00
|
|
|
endif()
|
2013-10-05 06:09:45 +08:00
|
|
|
if(WITH_OPENGL AND NOT HAVE_GTK3)
|
2019-04-16 05:29:17 +08:00
|
|
|
ocv_check_modules(GTKGLEXT gtkglext-1.0)
|
|
|
|
if(HAVE_GTKGLEXT)
|
2019-05-23 20:58:49 +08:00
|
|
|
ocv_append_build_options(HIGHGUI GTKGLEXT)
|
2019-04-16 05:29:17 +08:00
|
|
|
endif()
|
2012-05-30 17:00:32 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- OpenGl ---
|
|
|
|
ocv_clear_vars(HAVE_OPENGL HAVE_QT_OPENGL)
|
|
|
|
if(WITH_OPENGL)
|
2013-04-04 15:57:00 +08:00
|
|
|
if(WITH_WIN32UI OR (HAVE_QT AND QT_QTOPENGL_FOUND) OR HAVE_GTKGLEXT)
|
2012-05-30 17:00:32 +08:00
|
|
|
find_package (OpenGL QUIET)
|
|
|
|
if(OPENGL_FOUND)
|
|
|
|
set(HAVE_OPENGL TRUE)
|
|
|
|
list(APPEND OPENCV_LINKER_LIBS ${OPENGL_LIBRARIES})
|
|
|
|
if(QT_QTOPENGL_FOUND)
|
|
|
|
set(HAVE_QT_OPENGL TRUE)
|
|
|
|
else()
|
|
|
|
ocv_include_directories(${OPENGL_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif(WITH_OPENGL)
|
2013-07-10 22:20:34 +08:00
|
|
|
|
2018-11-08 00:21:33 +08:00
|
|
|
# --- Cocoa ---
|
2013-07-10 22:20:34 +08:00
|
|
|
if(APPLE)
|
2018-11-08 00:21:33 +08:00
|
|
|
if(NOT IOS AND CV_CLANG)
|
2013-07-10 22:20:34 +08:00
|
|
|
set(HAVE_COCOA YES)
|
|
|
|
endif()
|
|
|
|
endif()
|