Fix logic error in OpenCVFindLibsGUI.cmake
authorTony <exocoder@gmail.com>
Thu, 10 Apr 2014 22:28:23 +0000 (23:28 +0100)
committerTony <exocoder@gmail.com>
Sun, 13 Apr 2014 10:08:32 +0000 (11:08 +0100)
When with_gtk is selected but GTK3 is not present the current logic
fails to check for GTK2. This edit corrects this.

cmake/OpenCVFindLibsGUI.cmake

index f44261c..05de58c 100644 (file)
@@ -44,7 +44,8 @@ if(WITH_GTK AND NOT HAVE_QT)
   if(NOT WITH_GTK_2_X)
     CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
     set(HAVE_GTK HAVE_GTK3)
-  else()
+  endif()
+  if(NOT HAVE_GTK)
     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 version of ${MIN_VER_GTK} (${ALIASOF_gtk+-2.0_VERSION} found)")