diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7485b2ad5b01..04ea8d34bd6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,7 +38,6 @@ option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
 option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
 option(ENABLE_UTILS "Compile poppler command line utils." ON)
 option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
-option(ENABLE_GLIB "Compile poppler glib wrapper." ON)
 option(ENABLE_GTK_DOC "Whether to generate glib API documentation." OFF)
 option(ENABLE_QT4 "Compile poppler qt4 wrapper." ON)
 option(ENABLE_QT5 "Compile poppler qt5 wrapper." ON)
@@ -162,13 +161,8 @@ if(CAIRO_FOUND)
   set(CAIRO_REQ "cairo")
   set(POPPLER_GLIB_DISABLE_DEPRECATED "")
   set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "")
-  if(ENABLE_GLIB)
-    macro_optional_find_package(GLIB)
-    if(NOT GLIB_FOUND)
-      set(ENABLE_GLIB OFF)
-    endif()
-  endif()
-  if(ENABLE_GLIB)
+  macro_optional_find_package(GLIB)
+  if(GLIB_FOUND)
     # Check for introspection
     macro_optional_find_package(GObjectIntrospection 0.9.12)
     set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
@@ -178,7 +172,7 @@ if(CAIRO_FOUND)
   endif()
 else()
   set(CAIRO_FEATURE "#undef POPPLER_HAS_CAIRO")
-  set(ENABLE_GLIB OFF)
+  set(GLIB_FOUND OFF)
 endif()
 if(ENABLE_CPP)
   macro_optional_find_package(Iconv)
@@ -725,7 +719,7 @@ endif()
 if(ENABLE_UTILS)
   add_subdirectory(utils)
 endif()
-if(ENABLE_GLIB)
+if(GLIB_FOUND)
   add_subdirectory(glib)
 endif()
 add_subdirectory(test)
@@ -762,7 +756,7 @@ endif()
 if(ENABLE_QT5)
   poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
 endif()
-if(ENABLE_GLIB)
+if(GLIB_FOUND)
   poppler_create_install_pkgconfig(poppler-glib.pc lib${LIB_SUFFIX}/pkgconfig)
 endif()
 if(CAIRO_FOUND)
@@ -782,7 +776,7 @@ endif()
 show_end_message_yesno("cairo output" CAIRO_FOUND)
 show_end_message_yesno("qt4 wrapper" ENABLE_QT4)
 show_end_message_yesno("qt5 wrapper" ENABLE_QT5)
-show_end_message_yesno("glib wrapper" ENABLE_GLIB)
+show_end_message_yesno("glib wrapper" GLIB_FOUND)
 show_end_message_yesno("  introspection" INTROSPECTION_FOUND)
 show_end_message_yesno("  gtk-doc" ENABLE_GTK_DOC)
 show_end_message_yesno("cpp wrapper" ENABLE_CPP)
