[cmake] Use HINTS instead of PATHS when searching in paths from pkg-config
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Oct 2019 09:04:12 +0000 (09:04 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Oct 2019 09:04:12 +0000 (09:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202831

Reviewed by Carlos Garcia Campos.

HINTS and PATHS sections are similar, however HINTS is processed before
default system locations, while PATHS - after. If target file can be found
in the system, pkg-config results are ignored in case of PATHS, making it
impossible to override system version of library with PKG_CONFIG_PATH.

Note that CMake documentation recommends using PATHS for hard-coded guesses.

* Source/cmake/FindEnchant.cmake:
* Source/cmake/FindFontconfig.cmake:
* Source/cmake/FindLibEpoxy.cmake:
* Source/cmake/FindLibtasn1.cmake:
* Source/cmake/FindSqlite.cmake:

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

ChangeLog
Source/cmake/FindEnchant.cmake
Source/cmake/FindFontconfig.cmake
Source/cmake/FindLibEpoxy.cmake
Source/cmake/FindLibtasn1.cmake
Source/cmake/FindSqlite.cmake

index 48f3837..1999a9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2019-10-11  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Use HINTS instead of PATHS when searching in paths from pkg-config
+        https://bugs.webkit.org/show_bug.cgi?id=202831
+
+        Reviewed by Carlos Garcia Campos.
+
+        HINTS and PATHS sections are similar, however HINTS is processed before
+        default system locations, while PATHS - after. If target file can be found
+        in the system, pkg-config results are ignored in case of PATHS, making it
+        impossible to override system version of library with PKG_CONFIG_PATH.
+
+        Note that CMake documentation recommends using PATHS for hard-coded guesses.
+
+        * Source/cmake/FindEnchant.cmake:
+        * Source/cmake/FindFontconfig.cmake:
+        * Source/cmake/FindLibEpoxy.cmake:
+        * Source/cmake/FindLibtasn1.cmake:
+        * Source/cmake/FindSqlite.cmake:
+
 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
 
         Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.1 release
index 53b9a0e..9cd9758 100644 (file)
@@ -37,13 +37,13 @@ foreach (ENCHANT_NAME enchant-2 enchant)
 
     find_path(ENCHANT_INCLUDE_DIRS
         NAMES enchant.h
-        PATHS ${PC_ENCHANT_INCLUDEDIR}
+        HINTS ${PC_ENCHANT_INCLUDEDIR}
               ${PC_ENCHANT_INCLUDE_DIRS}
     )
 
     find_library(ENCHANT_LIBRARIES
         NAMES ${ENCHANT_NAME}
-        PATHS ${PC_ENCHANT_LIBDIR}
+        HINTS ${PC_ENCHANT_LIBDIR}
               ${PC_ENCHANT_LIBRARY_DIRS}
     )
 
index 2ed605d..2f3acaf 100644 (file)
@@ -49,16 +49,12 @@ else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
     endif (NOT WIN32)
 
     find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
-        PATHS
-        ${PC_FONTCONFIG_INCLUDEDIR}
-        ${PC_FONTCONFIG_INCLUDE_DIRS}
-        /usr/X11/include
+        HINTS ${PC_FONTCONFIG_INCLUDEDIR} ${PC_FONTCONFIG_INCLUDE_DIRS}
+        PATHS /usr/X11/include
     )
 
     find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
-        PATHS
-        ${PC_FONTCONFIG_LIBDIR}
-        ${PC_FONTCONFIG_LIBRARY_DIRS}
+        HINTS ${PC_FONTCONFIG_LIBDIR} ${PC_FONTCONFIG_LIBRARY_DIRS}
     )
 
     include(FindPackageHandleStandardArgs)
index e5897b5..e9a7a11 100644 (file)
@@ -36,12 +36,12 @@ endif ()
 
 find_path(LIBEPOXY_INCLUDE_DIRS
     NAMES epoxy/gl.h
-    PATHS ${PC_LIBEPOXY_INCLUDEDIR} ${PC_LIBEPOXY_INCLUDE_DIRS}
+    HINTS ${PC_LIBEPOXY_INCLUDEDIR} ${PC_LIBEPOXY_INCLUDE_DIRS}
 )
 
 find_library(LIBEPOXY_LIBRARIES
     NAMES epoxy
-    PATHS ${PC_LIBEPOXY_LIBDIR} ${PC_LIBEPOXY_LIBRARY_DIRS}
+    HINTS ${PC_LIBEPOXY_LIBDIR} ${PC_LIBEPOXY_LIBRARY_DIRS}
 )
 
 mark_as_advanced(LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES)
index 12e36cb..1475669 100644 (file)
@@ -33,12 +33,12 @@ pkg_check_modules(PC_LIBTASN1 libtasn1)
 
 find_path(LIBTASN1_INCLUDE_DIRS
     NAMES libtasn1.h
-    PATHS ${PC_LIBTASN1_INCLUDEDIR} ${PC_LIBTASN1_INCLUDE_DIRS}
+    HINTS ${PC_LIBTASN1_INCLUDEDIR} ${PC_LIBTASN1_INCLUDE_DIRS}
 )
 
 find_library(LIBTASN1_LIBRARIES
     NAMES tasn1
-    PATHS ${PC_LIBTASN1_LIBDIR} ${PC_LIBTASN1_LIBRARY_DIRS}
+    HINTS ${PC_LIBTASN1_LIBDIR} ${PC_LIBTASN1_LIBRARY_DIRS}
 )
 
 include(FindPackageHandleStandardArgs)
index 47caa36..10fc650 100644 (file)
@@ -47,15 +47,11 @@ if (NOT WIN32)
 endif (NOT WIN32)
 
 find_path(SQLITE_INCLUDE_DIR NAMES sqlite3.h
-    PATHS
-    ${PC_SQLITE_INCLUDEDIR}
-    ${PC_SQLITE_INCLUDE_DIRS}
+    HINTS ${PC_SQLITE_INCLUDEDIR} ${PC_SQLITE_INCLUDE_DIRS}
 )
 
 find_library(SQLITE_LIBRARIES NAMES sqlite3
-    PATHS
-    ${PC_SQLITE_LIBDIR}
-    ${PC_SQLITE_LIBRARY_DIRS}
+    HINTS ${PC_SQLITE_LIBDIR} ${PC_SQLITE_LIBRARY_DIRS}
 )
 
 include(FindPackageHandleStandardArgs)