mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
mprove Gtk2/3 options in cmake
Update to cmake files for to include minimum versions, and tidy up gtk operation. Files updated: CMakeLists.txt: WITH_GTK now uses Gtk3 by default. If not found then Gtk2 is used. WITH_GTK_2_X forces Gtk2.x use cmake/OpenCVFindLibsGUI.cmake Updated selection logic to implement methodology described above. Implemented warning if Gtk3 not found (and not overridden) Implemented error if Gtk does not meet minimum required version cmake/OpenCVMinDepVersions.cmake Added minimum Gtk version of 2.18.0
This commit is contained in:
@@ -41,12 +41,21 @@ endif()
|
||||
# --- GTK ---
|
||||
ocv_clear_vars(HAVE_GTK HAVE_GTK3 HAVE_GTHREAD HAVE_GTKGLEXT)
|
||||
if(WITH_GTK AND NOT HAVE_QT)
|
||||
if(WITH_GTK3)
|
||||
CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
|
||||
else()
|
||||
if(WITH_GTK_2_X)
|
||||
CHECK_MODULE(gtk+-2.0 HAVE_GTK)
|
||||
if(HAVE_GTK AND (ALIASOF_gtk+-2.0_VERSION VERSION_LESS MIN_VER_GTK))
|
||||
message (FATAL_ERROR "Gtk support requires a minimum gtk+ version of ${MIN_VER_GTK} (${ALIASOF_gtk+-2.0_VERSION} found)")
|
||||
endif()
|
||||
else()
|
||||
CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
|
||||
if(NOT HAVE_GTK3)
|
||||
message(WARNING "Unable to locate Gtk3 development libraries")
|
||||
endif()
|
||||
endif()
|
||||
CHECK_MODULE(gthread-2.0 HAVE_GTHREAD)
|
||||
if(HAVE_GTK OR HAVE_GTK3 AND NOT HAVE_GTHREAD)
|
||||
message(FATAL_ERROR "gthread not found. This library is required when building with Gtk support")
|
||||
endif()
|
||||
if(WITH_OPENGL AND NOT HAVE_GTK3)
|
||||
CHECK_MODULE(gtkglext-1.0 HAVE_GTKGLEXT)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user