[vlc-commits] tools: don't use sh.exe to call cygpath.exe in cmake
Steve Lhomme
git at videolan.org
Wed Oct 3 16:52:33 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Oct 3 16:51:00 2018 +0200| [e62999a6b1ccdf6b03204f486ec348eec7931922] | committer: Steve Lhomme
tools: don't use sh.exe to call cygpath.exe in cmake
Just look for the .exe in the path and run it. It will find its root from its
path.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e62999a6b1ccdf6b03204f486ec348eec7931922
---
extras/tools/cmake-msys-FindPkg.patch | 38 +++++++++++++++++++----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/extras/tools/cmake-msys-FindPkg.patch b/extras/tools/cmake-msys-FindPkg.patch
index 6b73e9eace..2448259dcc 100644
--- a/extras/tools/cmake-msys-FindPkg.patch
+++ b/extras/tools/cmake-msys-FindPkg.patch
@@ -1,23 +1,27 @@
---- cmake/Modules/FindPkgConfig.cmake.msys_pkg 2018-10-01 16:51:37.332632500 +0200
-+++ cmake/Modules/FindPkgConfig.cmake 2018-10-01 16:51:46.815041400 +0200
-@@ -344,6 +344,20 @@ macro(_pkg_check_modules_internal _is_re
- unset(_lib_dirs)
+--- ./Modules/FindPkgConfig.cmake.msys 2017-05-31 16:00:09.000000000 +0200
++++ ./Modules/FindPkgConfig.cmake 2018-10-03 16:43:37.880991800 +0200
+@@ -345,6 +345,24 @@ macro(_pkg_check_modules_internal _is_re
unset(_pkgconfig_path)
endif()
-+
+
+ if (CYGWIN OR MSYS)
-+ # fix the PKG_CONFIG_PATH transformed into a cmake path with incorrect msys pathes
-+ file(TO_CMAKE_PATH "$ENV{PKG_CONFIG_PATH}" _pkgconfig_path_cmake)
-+ execute_process(
-+ COMMAND sh.exe "-c" "cygpath -up '${_pkgconfig_path_cmake}'"
-+ RESULT_VARIABLE _cygpath_retval
-+ OUTPUT_VARIABLE _cygpath_outval
-+ ERROR_VARIABLE _cygpath_error
-+ OUTPUT_STRIP_TRAILING_WHITESPACE
-+ ERROR_STRIP_TRAILING_WHITESPACE)
-+ set(ENV{PKG_CONFIG_PATH} ${_cygpath_outval})
-+ #message(STATUS "new ENV $ENV{PKG_CONFIG_PATH}")
++ find_program(_cygpath_exe cygpath.exe NO_CMAKE_ENVIRONMENT_PATH)
++ if(_cygpath_exe)
++ # fix the PKG_CONFIG_PATH transformed into a cmake path with incorrect msys pathes
++ file(TO_CMAKE_PATH "$ENV{PKG_CONFIG_PATH}" _pkgconfig_path_cmake)
++ execute_process(
++ COMMAND ${_cygpath_exe} "-up" "${_pkgconfig_path_cmake}"
++ RESULT_VARIABLE _cygpath_retval
++ OUTPUT_VARIABLE _cygpath_outval
++ ERROR_VARIABLE _cygpath_error
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ ERROR_STRIP_TRAILING_WHITESPACE)
++ if (_cygpath_outval)
++ set(ENV{PKG_CONFIG_PATH} ${_cygpath_outval})
++ endif()
++ endif()
+ endif()
-
++
# iterate through module list and check whether they exist and match the required version
foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
+ set(_pkg_check_modules_exist_query)
More information about the vlc-commits
mailing list