extras/tools: have Hugo's pkgconfig patch in cmake
authorSteve Lhomme <robux4@ycbcr.xyz>
Thu, 23 Jan 2020 13:35:25 +0000 (14:35 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Thu, 23 Jan 2020 13:39:20 +0000 (14:39 +0100)
It's still not in 3.16.2 or 3.16.3...

extras/tools/0001-FindPkgConfig-Fix-path-manipulations-when-cross-comp.patch [new file with mode: 0644]
extras/tools/tools.mak

diff --git a/extras/tools/0001-FindPkgConfig-Fix-path-manipulations-when-cross-comp.patch b/extras/tools/0001-FindPkgConfig-Fix-path-manipulations-when-cross-comp.patch
new file mode 100644 (file)
index 0000000..3b5e765
--- /dev/null
@@ -0,0 +1,28 @@
+From f92a4b23994fa7516f16fbb5b3c02caa07534b3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
+Date: Mon, 2 Dec 2019 16:42:07 +0100
+Subject: [PATCH] FindPkgConfig: Fix path manipulations when cross compiling
+
+When cross compiling from a unix machine, if(UNIX) is false,
+whih causes the path not to be fixed for unix, leading to false
+negative if PKG_CONFIG_PATH needs to be probed
+---
+ Modules/FindPkgConfig.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
+index 5162a44b33..f4b6ea121c 100644
+--- a/Modules/FindPkgConfig.cmake
++++ b/Modules/FindPkgConfig.cmake
+@@ -337,7 +337,7 @@ macro(_pkg_set_path_internal)
+       # remove empty values from the list
+       list(REMOVE_ITEM _pkgconfig_path "")
+       file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
+-      if(UNIX)
++      if(CMAKE_HOST_UNIX)
+         string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
+         string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
+       endif()
+-- 
+2.19.1.windows.1
+
index 18dd37d..e1d8e0f 100644 (file)
@@ -92,6 +92,7 @@ cmake-$(CMAKE_VERSION).tar.gz:
 
 cmake: cmake-$(CMAKE_VERSION).tar.gz
        $(UNPACK)
+       $(APPLY) $(TOOLS)/0001-FindPkgConfig-Fix-path-manipulations-when-cross-comp.patch
        $(APPLY) $(TOOLS)/cmake-msys-FindPkg.patch
        $(MOVE)