From 3334281949cf80ef836c59c78a970c7fc060b1c1 Mon Sep 17 00:00:00 2001 From: Mikhail Titov Date: Sun, 6 Dec 2015 15:51:40 -0600 Subject: [PATCH] Search for patch tool with CMake This is to enable static build of "bundled" zlib with MSVC --- build/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index d8e5de8b..ba12f9ea 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -239,13 +239,13 @@ endif() find_package ( ZLIB ) if (NOT ZLIB_FOUND ) # We are probably on Windows + find_program( PATCH patch C:/Program Files/Git/usr/bin C:/msys64/usr/bin C:/msys32/usr/bin C:/Strawberry/c/bin ) include( ExternalProject ) ExternalProject_Add(zlib-project URL http://zlib.net/zlib-1.2.8.tar.gz URL_MD5 44d667c142d7cda120332623eab69f40 PREFIX ${CMAKE_CURRENT_BINARY_DIR}/zlib - # patch on Windows might be found in C:/Program Files/Git/usr/bin - PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake-zlib-static.patch + PATCH_COMMAND "${PATCH}" -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake-zlib-static.patch CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DWITH_STATIC=${WITH_STATIC} -DAMD64=ON -DASM686=ON "-DCMAKE_ASM_MASM_FLAGS=/W0 /safeseh"