]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - cmake/FindGTK3.cmake
Fix MSYS2 issues
[xonotic/netradiant.git] / cmake / FindGTK3.cmake
index 96dd46b0784aa74445bf39810eef3fc940735ac4..7bef3b0120cb3cca745f545724ebe9454f281175 100644 (file)
@@ -1,9 +1,21 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
-    if (GLIB_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+    if (GTK3_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GTK3 ${_pkgconfig_REQUIRED} gtk+-3.0)
+else ()
+    find_path(GTK3_INCLUDE_DIRS gtk.h)
+    # find_library(GTK3_LIBRARIES)
+    if (GTK3_INCLUDE_DIRS AND GTK3_LIBRARIES)
+        set(GTK3_FOUND 1)
+        if (NOT GTK3_FIND_QUIETLY)
+            message(STATUS "Found GTK3: ${GTK3_LIBRARIES}")
+        endif ()
+    elseif (GTK3_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GTK3")
+    elseif (NOT GTK3_FIND_QUIETLY)
+        message(STATUS "Could not find GTK3")
     endif ()
-    pkg_check_modules(GTK3 gtk+-3.0 ${_PACKAGE_ARGS})
 endif ()
+mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)