[CMake] Fix broken use of REQUIRED with find modules
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Aug 2017 16:39:14 +0000 (16:39 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Aug 2017 16:39:14 +0000 (16:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175427

Reviewed by Michael Catanzaro.

Module name passed to find_package_handle_standard_args() must exactly
match file name of CMake find module including letter case, e.g. "WebP"
must be used in FindWebP.cmake file. Otherwise find_package() arguments
(REQUIRED, QUIET, version) are not processed correctly.

To continue using old XXX_FOUND variables without case changes porting
to new find_package_handle_standard_args syntax which has FOUND_VAR
parameter. Unfortunately, variable name GTK_UNIX_PRINT_FOUND is not
allowed by find_package_handle_standard_args when package name is
GTKUnixPrint, so it's replaced to GTKUnixPrint_FOUND (default).

* Source/cmake/FindGTKUnixPrint.cmake:
* Source/cmake/FindGeoClue2.cmake:
* Source/cmake/FindHyphen.cmake:
* Source/cmake/FindLibEpoxy.cmake:
* Source/cmake/FindLibGBM.cmake:
* Source/cmake/FindLibsecret.cmake:
* Source/cmake/FindLibtasn1.cmake:
* Source/cmake/FindLibxkbcommon.cmake:
* Source/cmake/FindOpenGL.cmake:
* Source/cmake/FindOpenGLES2.cmake:
* Source/cmake/FindOpenWebRTC.cmake:
* Source/cmake/FindWPEBackend-mesa.cmake:
* Source/cmake/FindWPEBackend.cmake:
* Source/cmake/FindWayland.cmake:
* Source/cmake/FindWebP.cmake:
* Source/cmake/OptionsGTK.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
ChangeLog
Source/cmake/FindGTKUnixPrint.cmake
Source/cmake/FindGeoClue2.cmake
Source/cmake/FindHyphen.cmake
Source/cmake/FindLibEpoxy.cmake
Source/cmake/FindLibGBM.cmake
Source/cmake/FindLibsecret.cmake
Source/cmake/FindLibtasn1.cmake
Source/cmake/FindLibxkbcommon.cmake
Source/cmake/FindOpenGL.cmake
Source/cmake/FindOpenGLES2.cmake
Source/cmake/FindOpenWebRTC.cmake
Source/cmake/FindWPEBackend-mesa.cmake
Source/cmake/FindWPEBackend.cmake
Source/cmake/FindWayland.cmake
Source/cmake/FindWebP.cmake
Source/cmake/OptionsGTK.cmake

index 0d689dc..e5d7e33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2017-08-11  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [CMake] Fix broken use of REQUIRED with find modules
+        https://bugs.webkit.org/show_bug.cgi?id=175427
+
+        Reviewed by Michael Catanzaro.
+
+        Module name passed to find_package_handle_standard_args() must exactly
+        match file name of CMake find module including letter case, e.g. "WebP"
+        must be used in FindWebP.cmake file. Otherwise find_package() arguments
+        (REQUIRED, QUIET, version) are not processed correctly.
+
+        To continue using old XXX_FOUND variables without case changes porting
+        to new find_package_handle_standard_args syntax which has FOUND_VAR
+        parameter. Unfortunately, variable name GTK_UNIX_PRINT_FOUND is not
+        allowed by find_package_handle_standard_args when package name is
+        GTKUnixPrint, so it's replaced to GTKUnixPrint_FOUND (default).
+
+        * Source/cmake/FindGTKUnixPrint.cmake:
+        * Source/cmake/FindGeoClue2.cmake:
+        * Source/cmake/FindHyphen.cmake:
+        * Source/cmake/FindLibEpoxy.cmake:
+        * Source/cmake/FindLibGBM.cmake:
+        * Source/cmake/FindLibsecret.cmake:
+        * Source/cmake/FindLibtasn1.cmake:
+        * Source/cmake/FindLibxkbcommon.cmake:
+        * Source/cmake/FindOpenGL.cmake:
+        * Source/cmake/FindOpenGLES2.cmake:
+        * Source/cmake/FindOpenWebRTC.cmake:
+        * Source/cmake/FindWPEBackend-mesa.cmake:
+        * Source/cmake/FindWPEBackend.cmake:
+        * Source/cmake/FindWayland.cmake:
+        * Source/cmake/FindWebP.cmake:
+        * Source/cmake/OptionsGTK.cmake:
+
 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
index de3b3eb..0a98862 100644 (file)
@@ -1,7 +1,7 @@
 # - Try to find gtk-unix-print
 # Once done, this will define
 #
-#  GTK_UNIX_PRINT_FOUND - system has gtk-unix-print
+#  GTKUnixPrint_FOUND - system has gtk-unix-print
 #  GTK_UNIX_PRINT_INCLUDE_DIRS - the gtk-unix-print include directories
 #  GTK_UNIX_PRINT_LIBRARIES - link these to use gtk-unix-print
 #
@@ -46,4 +46,4 @@ if (GTK_UNIX_PRINT_VERSION)
 endif ()
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK_UNIX_PRINT DEFAULT_MSG GTK_UNIX_PRINT_INCLUDE_DIRS GTK_UNIX_PRINT_LIBRARIES VERSION_OK)
+find_package_handle_standard_args(GTKUnixPrint REQUIRED_VARS GTK_UNIX_PRINT_INCLUDE_DIRS GTK_UNIX_PRINT_LIBRARIES VERSION_OK)
index 8bb62cb..84179cd 100644 (file)
@@ -46,4 +46,5 @@ if (GEOCLUE2_VERSION)
 endif ()
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOCLUE2 DEFAULT_MSG VERSION_OK)
+find_package_handle_standard_args(GeoClue2 REQUIRED_VARS VERSION_OK
+                                  FOUND_VAR GEOCLUE2_FOUND)
index 47dfdb4..f8c30b7 100644 (file)
@@ -34,7 +34,8 @@ find_path(HYPHEN_INCLUDE_DIR NAMES hyphen.h)
 find_library(HYPHEN_LIBRARIES NAMES hyphen hnj)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(HYPHEN DEFAULT_MSG HYPHEN_INCLUDE_DIR HYPHEN_LIBRARIES)
+find_package_handle_standard_args(Hyphen REQUIRED_VARS HYPHEN_INCLUDE_DIR HYPHEN_LIBRARIES
+                                  FOUND_VAR HYPHEN_FOUND)
 
 if (HYPHEN_INCLUDE_DIR AND HYPHEN_LIBRARIES)
     set(HYPHEN_FOUND 1)
index 7b93be6..3beff63 100644 (file)
@@ -43,5 +43,5 @@ find_library(LIBEPOXY_LIBRARIES
 mark_as_advanced(LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBEPOXY REQUIRED_VARS LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES
+find_package_handle_standard_args(LibEpoxy REQUIRED_VARS LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES
                                            VERSION_VAR   PC_LIBEPOXY_VERSION)
index d2091cb..91f0427 100644 (file)
@@ -41,6 +41,7 @@ find_library(LIBGBM_LIBRARIES
 )
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGBM DEFAULT_MSG LIBGBM_LIBRARIES)
+find_package_handle_standard_args(LibGBM REQUIRED_VARS LIBGBM_LIBRARIES
+                                  FOUND_VAR LIBGBM_FOUND)
 
 mark_as_advanced(LIBGBM_INCLUDE_DIRS LIBGBM_LIBRARIES)
index d33228a..7cfe1df 100644 (file)
@@ -46,4 +46,5 @@ if (LIBSECRET_VERSION)
 endif ()
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSECRET DEFAULT_MSG LIBSECRET_INCLUDE_DIRS LIBSECRET_LIBRARIES VERSION_OK)
+find_package_handle_standard_args(Libsecret REQUIRED_VARS LIBSECRET_INCLUDE_DIRS LIBSECRET_LIBRARIES VERSION_OK
+                                  FOUND_VAR LIBSECRET_FOUND)
index 09e6df3..12e36cb 100644 (file)
@@ -42,6 +42,7 @@ find_library(LIBTASN1_LIBRARIES
 )
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBTASN1 DEFAULT_MSG LIBTASN1_LIBRARIES)
+find_package_handle_standard_args(Libtasn1 REQUIRED_VARS LIBTASN1_LIBRARIES
+                                  FOUND_VAR LIBTASN1_FOUND)
 
 mark_as_advanced(LIBTASN1_INCLUDE_DIRS LIBTASN1_LIBRARIES)
index 2862a28..7f1fb0e 100644 (file)
@@ -32,4 +32,5 @@ find_package(PkgConfig)
 pkg_check_modules(LIBXKBCOMMON xkbcommon)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBXKBCOMMON DEFAULT_MSG LIBXKBCOMMON_FOUND)
+find_package_handle_standard_args(Libxkbcommon REQUIRED_VARS LIBXKBCOMMON_FOUND
+                                  FOUND_VAR LIBXKBCOMMON_FOUND)
index 60721cd..372e891 100644 (file)
@@ -48,7 +48,8 @@ find_library(OPENGL_LIBRARIES NAMES ${OPENGL_NAMES}
 )
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGL DEFAULT_MSG OPENGL_INCLUDE_DIRS OPENGL_LIBRARIES)
+find_package_handle_standard_args(OpenGL REQUIRED_VARS OPENGL_INCLUDE_DIRS OPENGL_LIBRARIES
+                                  FOUND_VAR OPENGL_FOUND)
 
 mark_as_advanced(OPENGL_INCLUDE_DIRS OPENGL_LIBRARIES)
 
index 5116630..1796929 100644 (file)
@@ -22,6 +22,7 @@ find_library(OPENGLES2_LIBRARIES NAMES ${OPENGLES2_NAMES}
 )
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 DEFAULT_MSG OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARIES)
+find_package_handle_standard_args(OpenGLES2 REQUIRED_VARS OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARIES
+                                  FOUND_VAR OPENGLES2_FOUND)
 
 mark_as_advanced(OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARIES)
index 6428c62..54e6c7d 100644 (file)
@@ -67,4 +67,5 @@ set(OPENWEBRTC_LIBRARIES
 mark_as_advanced(OPENWEBRTC_INCLUDE_DIRS OPENWEBRTC_LIBRARIES)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENWEBRTC DEFAULT_MSG OPENWEBRTC_INCLUDE_DIRS OPENWEBRTC_LIBRARIES VERSION_OK)
+find_package_handle_standard_args(OpenWebRTC REQUIRED_VARS OPENWEBRTC_INCLUDE_DIRS OPENWEBRTC_LIBRARIES VERSION_OK
+                                  FOUND_VAR OPENWEBRTC_FOUND)
index 616154e..52f7e8d 100644 (file)
@@ -44,4 +44,4 @@ find_library(WPE_MESA_LIBRARIES
 mark_as_advanced(WPE_MESA_INCLUDE_DIRS WPE_MESA_LIBRARIES)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WPE_MESA REQUIRED_VARS WPE_MESA_INCLUDE_DIRS WPE_MESA_LIBRARIES)
+find_package_handle_standard_args(WPEBackend-mesa REQUIRED_VARS WPE_MESA_INCLUDE_DIRS WPE_MESA_LIBRARIES)
index c7a93d0..8b5cff0 100644 (file)
@@ -44,4 +44,4 @@ find_library(WPE_LIBRARIES
 mark_as_advanced(WPE_INCLUDE_DIRS WPE_LIBRARIES)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WPE REQUIRED_VARS WPE_INCLUDE_DIRS WPE_LIBRARIES)
+find_package_handle_standard_args(WPEBackend REQUIRED_VARS WPE_INCLUDE_DIRS WPE_LIBRARIES)
index 215a1c2..04b91f4 100644 (file)
@@ -32,4 +32,5 @@ find_package(PkgConfig)
 pkg_check_modules(WAYLAND wayland-client wayland-server wayland-egl)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES)
+find_package_handle_standard_args(Wayland REQUIRED_VARS WAYLAND_LIBRARIES
+                                  FOUND_VAR WAYLAND_FOUND)
index 6772352..969708e 100644 (file)
@@ -48,4 +48,5 @@ find_library(
 mark_as_advanced(WEBP_LIBRARIES)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES)
+find_package_handle_standard_args(WebP REQUIRED_VARS WEBP_INCLUDE_DIRS WEBP_LIBRARIES
+                                  FOUND_VAR WEBP_FOUND)
index dca9315..3f7372d 100644 (file)
@@ -204,7 +204,7 @@ set(GDK_LIBRARIES ${GDK3_LIBRARIES})
 set(GDK_INCLUDE_DIRS ${GDK3_INCLUDE_DIRS})
 
 SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_GESTURES ${GTK3_SUPPORTS_GESTURES})
-SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTK_UNIX_PRINT_FOUND})
+SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTKUnixPrint_FOUND})
 
 set(glib_components gio gio-unix gobject gthread gmodule)
 find_package(GLIB 2.36 REQUIRED COMPONENTS ${glib_components})