AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2017

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2017.06.07 22:30 "[PATCH] Windows CI support for GitHub and AppVeyor", by Roger Leigh
2017.06.08 09:47 "Re: [PATCH] Windows CI support for GitHub and AppVeyor", by <rleigh@codelibre.net>
2017.06.08 11:22 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by <rleigh@codelibre.net>
2017.06.08 20:46 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Even Rouault
2017.06.09 10:54 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by <rleigh@codelibre.net>
2017.06.09 11:12 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Even Rouault
2017.06.09 13:18 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Bob Friesenhahn
2017.06.09 21:10 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Roger Leigh
2017.06.09 21:23 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Even Rouault
2017.06.09 22:00 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Roger Leigh
2017.06.09 22:05 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Aaron Boxer
2017.06.09 23:15 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Even Rouault
2017.06.10 01:56 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Kemp Watson
2017.06.10 08:58 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Roger Leigh
2017.06.10 09:33 "Re: [PATCH] Unix/Linux CI support for GitHub and Travis", by Even Rouault

2017.06.08 09:47 "Re: [PATCH] Windows CI support for GitHub and AppVeyor", by <rleigh@codelibre.net>

On 2017-06-07 23:30, Roger Leigh wrote:
> Hi,
> 
> Attached are two patches to improve the Windows support for libtiff.
> 
> - 0001-cmake-Improve-Cygwin-and-MingGW-test-support.patch
>   This patch makes the CMake build system support running the tests
>   with MinGW or Cygwin
> 
> - 0002-ci-Add-AppVeyor-support.patch
>   This patch adds a .appveyor.yml file to the top-level.  This allows
>   one to opt in to having a branch built on Windows with Cygwin,
>   MinGW and MSVC automatically when a branch is pushed to GitHub,
>   GitLab, BitBucket or any other supported git hosting service.

Updated copies of the patch attached.  I also added support for testing 
the nmake Makefile.vc build as well.

You can see this in action here:
https://ci.appveyor.com/project/rleigh-codelibre/libtiff/build/1.0.43


Regards,
Roger

From 4cb0b53fbc12b202644427f386cf436fd309fcdd Mon Sep 17 00:00:00 2001
From: Roger Leigh <rleigh@codelibre.net>
Date: Wed, 7 Jun 2017 23:04:04 +0100
Subject: [PATCH 1/2] cmake: Improve Cygwin and MingGW test support

---
 CMakeLists.txt            |  2 +-
 test/CMakeLists.txt       | 29 +++++++++++++++++------------
 test/TiffTestCommon.cmake |  5 +++++
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ee6fd46..52b5ae99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -467,7 +467,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER
               HOST_BIG_ENDIAN HAVE_IEEEFP)
 
 # Large file support
-if (UNIX)
+if (UNIX OR MINGW)
   # This might not catch every possibility catered for by
   # AC_SYS_LARGEFILE.
   add_definitions(-D_FILE_OFFSET_BITS=64)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b9e373f9..731aa806 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -185,6 +185,18 @@ target_link_libraries(custom_dir tiff port)
 set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output")
 file(MAKE_DIRECTORY "${TEST_OUTPUT}")
 
+set(tiff_test_extra_args
+    "-DTIFFCP=$<TARGET_FILE:tiffcp>"
+    "-DTIFFINFO=$<TARGET_FILE:tiffinfo>"
+    "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
+    "-DLIBTIFF=$<TARGET_FILE:tiff>")
+if(WIN32)
+  list(APPEND tiff_test_extra_args "-DWIN32=${WIN32}")
+endif()
+if(CYGWIN)
+  list(APPEND tiff_test_extra_args "-DCYGWIN=${CYGWIN}")
+endif()
+
 macro(tiff_test_convert name command1 command2 command3 infile outfile
 validate)
   add_test(NAME "${name}"
            COMMAND "${CMAKE_COMMAND}"
@@ -193,9 +205,8 @@ macro(tiff_test_convert name command1 command2 command3
infile outfile validate)
            "-DCONVERT_COMMAND3=${command3}"
            "-DINFILE=${infile}"
            "-DOUTFILE=${outfile}"
-           "-DTIFFINFO=$<TARGET_FILE:tiffinfo>"
-           "-DLIBTIFF=$<TARGET_FILE:tiff>"
            "-DVALIDATE=${validate}"
+           ${tiff_test_extra_args}
            -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake")
 endmacro()
 
@@ -205,8 +216,7 @@ macro(tiff_test_stdout name command infile outfile)
            "-DSTDOUT_COMMAND=${command}"
            "-DINFILE=${infile}"
            "-DOUTFILE=${outfile}"
-           "-DTIFFINFO=$<TARGET_FILE:tiffinfo>"
-           "-DLIBTIFF=$<TARGET_FILE:tiff>"
+           ${tiff_test_extra_args}
            -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake")
 endmacro()
 
@@ -215,8 +225,7 @@ macro(tiff_test_reader name command infile)
            COMMAND "${CMAKE_COMMAND}"
            "-DREADER_COMMAND=${command}"
            "-DINFILE=${infile}"
-           "-DTIFFINFO=$<TARGET_FILE:tiffinfo>"
-           "-DLIBTIFF=$<TARGET_FILE:tiff>"
+           ${tiff_test_extra_args}
            -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake")
 endmacro()
 
@@ -344,9 +353,7 @@ add_test(NAME "tiffcp-split"
          "-DTESTFILES=${ESCAPED_UNCOMPRESSED}"
          "-DCONJOINED=${TEST_OUTPUT}/tiffcp-split-conjoined.tif"
          "-DSPLITFILE=${TEST_OUTPUT}/tiffcp-split-split-"
-         "-DTIFFCP=$<TARGET_FILE:tiffcp>"
-         "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
-         "-DLIBTIFF=$<TARGET_FILE:tiff>"
+         ${tiff_test_extra_args}
          -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffSplitTest.cmake")
 add_test(NAME "tiffcp-split-join"
          COMMAND "${CMAKE_COMMAND}"
@@ -354,9 +361,7 @@ add_test(NAME "tiffcp-split-join"
          "-DCONJOINED=${TEST_OUTPUT}/tiffcp-split-join-conjoined.tif"
          "-DSPLITFILE=${TEST_OUTPUT}/tiffcp-split-join-split-"
          "-DRECONJOINED=${TEST_OUTPUT}/tiffcp-split-join-reconjoined.tif"
-         "-DTIFFCP=$<TARGET_FILE:tiffcp>"
-         "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
-         "-DLIBTIFF=$<TARGET_FILE:tiff>"
+         ${tiff_test_extra_args}
          -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffSplitTest.cmake")
 
 # PDF
diff --git a/test/TiffTestCommon.cmake b/test/TiffTestCommon.cmake
index 50a4c34a..a0db6782 100644
--- a/test/TiffTestCommon.cmake
+++ b/test/TiffTestCommon.cmake
@@ -101,3 +101,8 @@ if(WIN32)
   file(TO_NATIVE_PATH "${LIBTIFF_DIR}" LIBTIFF_DIR)
   set(ENV{PATH} "${LIBTIFF_DIR};$ENV{PATH}")
 endif()
+if(CYGWIN)
+  get_filename_component(LIBTIFF_DIR "${LIBTIFF}" DIRECTORY)
+  file(TO_NATIVE_PATH "${LIBTIFF_DIR}" LIBTIFF_DIR)
+  set(ENV{PATH} "${LIBTIFF_DIR}:$ENV{PATH}")
+endif()
-- 
2.11.0


From 50bdbb8fbb0867dcf5423da46b9c5e8446a16a3c Mon Sep 17 00:00:00 2001
From: Roger Leigh <rleigh@dundee.ac.uk>
Date: Wed, 7 Jun 2017 14:05:40 +0100
Subject: [PATCH 2/2] ci: Add AppVeyor support

---
 .appveyor.yml | 103
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 00000000..fb534236
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,103 @@
+environment:
+  AV_PROJECTS: 'c:\projects'
+  AV_TIFF_DOWNLOAD: 'c:\projects\download'
+  AV_TIFF_SOURCE: 'c:\projects\libtiff'
+  AV_TIFF_BUILD: 'c:\projects\build'
+  AV_TIFF_INSTALL: 'c:\projects\install'
+
+  matrix:
+    - compiler: cygwin-cmake
+      generator: Unix Makefiles
+      shared: ON
+    - compiler: cygwin-cmake
+      generator: Unix Makefiles
+      shared: OFF
+    - compiler: mingw64-cmake
+      generator: Unix Makefiles
+      shared: ON
+    - compiler: mingw64-cmake
+      generator: Unix Makefiles
+      shared: OFF
+    - compiler: vc14-cmake
+      generator: Visual Studio 14 2015 Win64
+      shared: ON
+    - compiler: vc14-cmake
+      generator: Visual Studio 14 2015 Win64
+      shared: OFF
+    - compiler: vc14-nmake
+
+cache:
+  - 'c:\projects\download -> appveyor.yml'
+
+# Operating system (build VM template)
+os: 'Visual Studio 2015'
+
+# clone directory
+clone_folder: 'c:\projects\libtiff'
+clone_depth: 5
+
+platform: x64
+configuration: Release
+
+init:
+  - git config --global core.autocrlf input
+  - 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u
%AV_TIFF_SOURCE%`) DO SET AV_TIFF_CYG_SOURCE=%%F'
+  - 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u
%AV_TIFF_INSTALL%`) DO SET AV_TIFF_CYG_INSTALL=%%F'
+  - 'if %compiler%==cygwin-cmake C:\Cygwin64\setup-x86_64 -q -R C:\Cygwin64
-s http://cygwin.mirror.constant.com -l %AV_TIFF_DOWNLOAD%\cygwin -P
cmake,libjpeg-devel,zlib-devel'
+  - 'if %compiler%==cygwin-cmake set "PATH=C:\Cygwin64\bin;%PATH%"'
+  - 'if %compiler%==mingw64-cmake set
"PATH=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%"'
+  - set "AV_CMAKE_ARGS=-DBUILD_SHARED_LIBS:BOOL=%shared%"
+  - 'if %compiler%==mingw64-cmake set
"PATH=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%"'
+  - 'if %compiler%==mingw64-cmake set "AV_CMAKE_ARGS=%AV_CMAKE_ARGS%
-DCMAKE_MAKE_PROGRAM=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\mingw32-make"'
+  - set "AV_TIFF_CMAKE_SOURCE=%AV_TIFF_SOURCE%"
+  - set "AV_TIFF_CMAKE_INSTALL=%AV_TIFF_INSTALL%"
+  - 'if %compiler%==cygwin-cmake set
"AV_TIFF_CMAKE_SOURCE=%AV_TIFF_CYG_SOURCE%'
+  - 'if %compiler%==cygwin-cmake set
"AV_TIFF_CMAKE_INSTALL=%AV_TIFF_CYG_INSTALL%'
+  - 'if %compiler%==vc14-nmake call
"%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %platform%'
+
+before_build:
+  - mkdir %AV_TIFF_BUILD%
+  - cd %AV_TIFF_BUILD%
+  - if NOT %compiler%==vc14-nmake echo Running cmake -G "%generator%"
-DCMAKE_INSTALL_PREFIX=%AV_TIFF_CMAKE_INSTALL%
-DCMAKE_BUILD_TYPE=%configuration% %AV_TIFF_CMAKE_SOURCE%
+  - 'if %compiler%==cygwin-cmake bash -c "cmake -G \"%generator%\"
-DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL%
-DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%"'
+  - 'if %compiler%==mingw64-cmake cmake -G "%generator%"
-DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL%
-DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'
+  - 'if %compiler%==vc14-cmake cmake -G "%generator%"
-DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL%
-DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'
+
+build_script:
+  - if NOT %compiler%==vc14-nmake cd %AV_TIFF_BUILD%
+  - if %compiler%==vc14-nmake cd %AV_TIFF_SOURCE%
+  - 'if %compiler%==cygwin-cmake bash -c "cmake --build . --config
%configuration% --target install"'
+  - 'if %compiler%==mingw64-cmake cmake --build . --config %configuration%
--target install'
+  - 'if %compiler%==vc14-cmake cmake --build . --config %configuration%
--target install'
+  - 'if %compiler%==vc14-nmake nmake /f Makefile.vc
EXTRAFLAGS=/DHAVE_SNPRINTF=1'
+  - 'if %compiler%==vc14-nmake mkdir %AV_TIFF_INSTALL%'
+  - 'if %compiler%==vc14-nmake mkdir %AV_TIFF_INSTALL%\bin'
+  - 'if %compiler%==vc14-nmake mkdir %AV_TIFF_INSTALL%\lib'
+  - 'if %compiler%==vc14-nmake mkdir %AV_TIFF_INSTALL%\include'
+  - 'if %compiler%==vc14-nmake copy tools\*.exe %AV_TIFF_INSTALL%\bin'
+  - 'if %compiler%==vc14-nmake copy port\*.lib %AV_TIFF_INSTALL%\lib'
+  - 'if %compiler%==vc14-nmake copy libtiff\tiff.h
%AV_TIFF_INSTALL%\include'
+  - 'if %compiler%==vc14-nmake copy libtiff\tiffio.h
%AV_TIFF_INSTALL%\include'
+  - 'if %compiler%==vc14-nmake copy libtiff\tiffvers.h
%AV_TIFF_INSTALL%\include'
+  - 'if %compiler%==vc14-nmake copy libtiff\tiffconf.h
%AV_TIFF_INSTALL%\include'
+  - 'if %compiler%==vc14-nmake copy libtiff\tiffio.hxx
%AV_TIFF_INSTALL%\include'
+
+# scripts to run after build
+after_build:
+  - cd %AV_TIFF_BUILD%
+  - '7z a %AV_TIFF_SOURCE%\libtiff-build.zip * -tzip'
+  - cd %AV_TIFF_INSTALL%
+  - '7z a %AV_TIFF_SOURCE%\libtiff.zip * -tzip'
+
+before_test:
+  - cd %AV_TIFF_BUILD%
+  - 'if %compiler%==cygwin-cmake bash -c "ctest -V -C %configuration%"'
+  - 'if %compiler%==mingw64-cmake ctest -V -C %configuration%'
+  - 'if %compiler%==vc14-cmake ctest -V -C %configuration%'
+# vc14-nmake does not support unit tests
+
+artifacts:
+  - path: libtiff.zip
+    name: libtiff.zip
+  - path: libtiff-build.zip
+    name: libtiff-build.zip
-- 
2.11.0