2012-05-30 09:00:32 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Detect 3rd-party GUI libraries
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2013-03-27 08:03:51 -07:00
|
|
|
#--- Win32 UI ---
|
|
|
|
ocv_clear_vars(HAVE_WIN32UI)
|
|
|
|
if(WITH_WIN32UI)
|
2013-08-22 15:46:13 +04:00
|
|
|
try_compile(HAVE_WIN32UI
|
|
|
|
"${OpenCV_BINARY_DIR}"
|
2013-03-27 08:03:51 -07:00
|
|
|
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
|
2013-08-22 15:46:13 +04:00
|
|
|
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=user32;gdi32")
|
|
|
|
endif()
|
2013-03-27 08:03:51 -07:00
|
|
|
|
2012-05-30 09:00:32 +00:00
|
|
|
# --- QT4 ---
|
2013-04-17 22:02:01 +04:00
|
|
|
ocv_clear_vars(HAVE_QT HAVE_QT5)
|
2012-05-30 09:00:32 +00:00
|
|
|
if(WITH_QT)
|
2013-07-22 13:55:49 +04:00
|
|
|
if(NOT WITH_QT EQUAL 4)
|
2013-04-17 22:02:01 +04:00
|
|
|
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)
|
|
|
|
find_package(Qt5OpenGL)
|
|
|
|
if(Qt5OpenGL_FOUND)
|
|
|
|
set(QT_QTOPENGL_FOUND ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_QT)
|
2013-06-06 14:09:33 +04:00
|
|
|
find_package(Qt4 REQUIRED QtCore QtGui QtTest)
|
2013-04-17 22:02:01 +04:00
|
|
|
if(QT4_FOUND)
|
|
|
|
set(HAVE_QT TRUE)
|
|
|
|
endif()
|
2012-05-30 09:00:32 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- GTK ---
|
2013-10-02 21:16:40 +01:00
|
|
|
ocv_clear_vars(HAVE_GTK HAVE_GTK3 HAVE_GTHREAD HAVE_GTKGLEXT)
|
2012-05-30 09:00:32 +00:00
|
|
|
if(WITH_GTK AND NOT HAVE_QT)
|
2014-04-01 23:01:18 +01:00
|
|
|
if(NOT WITH_GTK_2_X)
|
|
|
|
CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
|
2014-04-12 22:43:42 +01:00
|
|
|
if(HAVE_GTK3)
|
|
|
|
set(HAVE_GTK TRUE)
|
|
|
|
endif()
|
2014-04-10 23:28:23 +01:00
|
|
|
endif()
|
|
|
|
if(NOT HAVE_GTK)
|
2013-10-02 21:16:40 +01:00
|
|
|
CHECK_MODULE(gtk+-2.0 HAVE_GTK)
|
2013-11-26 21:35:03 +00:00
|
|
|
if(HAVE_GTK AND (ALIASOF_gtk+-2.0_VERSION VERSION_LESS MIN_VER_GTK))
|
2014-03-31 22:05:09 +01:00
|
|
|
message (FATAL_ERROR "GTK support requires a minimum version of ${MIN_VER_GTK} (${ALIASOF_gtk+-2.0_VERSION} found)")
|
2014-04-09 22:07:59 +01:00
|
|
|
set(HAVE_GTK FALSE)
|
2013-11-26 21:35:03 +00:00
|
|
|
endif()
|
2013-10-02 21:16:40 +01:00
|
|
|
endif()
|
2012-05-30 09:00:32 +00:00
|
|
|
CHECK_MODULE(gthread-2.0 HAVE_GTHREAD)
|
2014-04-09 22:07:59 +01:00
|
|
|
if(HAVE_GTK AND NOT HAVE_GTHREAD)
|
2014-03-31 22:05:09 +01:00
|
|
|
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
|
2013-11-26 21:35:03 +00:00
|
|
|
endif()
|
2013-10-04 23:09:45 +01:00
|
|
|
if(WITH_OPENGL AND NOT HAVE_GTK3)
|
2012-05-30 09:00:32 +00:00
|
|
|
CHECK_MODULE(gtkglext-1.0 HAVE_GTKGLEXT)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# --- OpenGl ---
|
|
|
|
ocv_clear_vars(HAVE_OPENGL HAVE_QT_OPENGL)
|
|
|
|
if(WITH_OPENGL)
|
2013-04-04 11:57:00 +04:00
|
|
|
if(WITH_WIN32UI OR (HAVE_QT AND QT_QTOPENGL_FOUND) OR HAVE_GTKGLEXT)
|
2012-05-30 09:00:32 +00: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 18:20:34 +04:00
|
|
|
|
|
|
|
# --- Carbon & Cocoa ---
|
|
|
|
if(APPLE)
|
|
|
|
if(WITH_CARBON)
|
|
|
|
set(HAVE_CARBON YES)
|
2014-02-21 01:39:48 -05:00
|
|
|
elseif(NOT IOS AND CMAKE_COMPILER_IS_CLANGCXX)
|
2013-07-10 18:20:34 +04:00
|
|
|
set(HAVE_COCOA YES)
|
|
|
|
endif()
|
|
|
|
endif()
|