X-Account-Key: account1
X-UIDL: a6e966db5962fcf603f5cfb5bf04c44e
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
Received: from lists.maptools.org (lothlorien.howardsilvan.com [127.0.0.1])
	by mail.howardsilvan.com (Postfix) with ESMTPS id 4FA7B6721A8
	for <faxguy@howardsilvan.com>; Mon, 31 Aug 2015 08:17:28 -0700 (PDT)
Received: from lists.maptools.org ([94.23.4.142] helo=lists.maptools.org)
	by lothlorien.howardsilvan.com
	with SMTP (2.3.3); 31 Aug 2015	08:17:27 -0800
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id BD17235C2A7;
	Mon, 31 Aug 2015 10:15:52 -0500 (EST)
Received: from b.painless.aa.net.uk (b.painless.aa.net.uk [81.187.30.52])
	by lists.maptools.org (Postfix) with ESMTPS id 0730435C104
	for <tiff@lists.maptools.org>; Mon, 31 Aug 2015 10:12:00 -0500 (EST)
Received: from g.hopeless.aa.net.uk ([2001:8b0:0:30:230:48ff:fe94:feec]	helo=g.mail.aa.net.uk)
	by b.painless.aa.net.uk
	with esmtpa (Exim 4.77)	(envelope-from <rleigh@codelibre.net>)
	id 1ZWQks-0003OX-Kf	for tiff@lists.maptools.org;
	Mon, 31 Aug 2015 16:12:18 +0100
Received: from 134.36.162.202	(SquirrelMail authenticated user rleigh@codelibre.net)
	by g.mail.aa.net.uk with HTTP; Mon, 31 Aug 2015 16:12:18 +0100 (BST)
Message-ID: <d2b11ba2842dc98a617871ebf6d72a25.squirrel@g.mail.aa.net.uk>
Date: Mon, 31 Aug 2015 16:12:18 +0100 (BST)
From: rleigh@codelibre.net
To: tiff@lists.maptools.org
User-Agent: SquirrelMail/1.4.17
MIME-Version: 1.0
X-Priority: 3 (Normal)
Importance: Normal
Subject: [Tiff] [patch] cmake fixes
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-Assp-ID: lothlorien.howardsilvan.com m1-34248-02773
X-Assp-Session: 7FE084A980E8 (mail 1)
X-Assp-Detected-RIP: 2001:8b0:0:30:230:48ff:fe94:feec, 81.187.30.52
X-Assp-Source-IP: 2001:8b0:0:30:230:48ff:fe94:feec
X-Assp-Envelope-From: tiff-bounces@lists.maptools.org
X-Assp-Intended-For: faxguy@howardsilvan.com
X-Assp-Version: 2.3.3(14029) on lothlorien.howardsilvan.com
X-Assp-Server-TLS: yes
X-Assp-Delay: not delayed (whitelisted); 31 Aug 2015 08:17:28 -0800
X-Assp-Whitelisted: Yes (whitelistdb)
Return-Path: tiff-bounces@lists.maptools.org
Content-Type: multipart/mixed; boundary="----=_20150831161218_61353"


------=_20150831161218_61353
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

See attached patches.

01: CMake reads all version information directly from configure.ac to
avoid duplication of values.  This basically greps over the file for the
LIBTIFF_* variables, then translates them to the form needed for cmake.=20
This includes the release version and libtool shared library version
information.

02: Make shared/static library building configurable.  Currently it alway=
s
builds shared libraries, with static libs having a _static suffix (copyin=
g
zlib, but it means it's got a non-standard name).  CMake has a
-DBUILD_SHARED_LIBS=3DON|OFF option to select one or the other, which is =
now
used instead.  There's now a single "tiff" target to build either shared
or static as required, and all the tests and tools are linked with this.=20
Note: the Windows tests fail when linked with a static libtiff (says:
libtiff.dll not found).  Not really a regression since this was not teste=
d
up to this point, and it's likely the unit tests haven't (ever?) been run
on Windows with a static libtiff, so there's some additional portability
issue here to address.  Works fine on UNIX systems, and fine on Windows
with the default to build a DLL.

03: Adds a missing file which wasn't being distributed, causing unit test=
s
to fail.  Note that "find . -name '*.cmake'" lists all the CMake files
which need distributing in addition to all the CMakeLists.txt files (whic=
h
now are distributed).


Regards,
Roger Leigh
------=_20150831161218_61353
Content-Type: text/x-diff; name="01-cmake-version.patch"
Content-Disposition: attachment; filename="01-cmake-version.patch"
Content-Transfer-Encoding: quoted-printable

Index: CMakeLists.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/CMakeLists.txt,v
retrieving revision 1.5
diff -u -r1.5 CMakeLists.txt
--- CMakeLists.txt	31 Aug 2015 00:01:18 -0000	1.5
+++ CMakeLists.txt	31 Aug 2015 14:31:17 -0000
@@ -42,13 +42,36 @@
   cmake_policy(SET CMP0054 NEW)
 endif(POLICY CMP0054)
=20
+# Read version information from configure.ac.
+FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure)
+STRING(REGEX REPLACE ";" "\\\\;" configure "${configure}")
+STRING(REGEX REPLACE "\n" ";" configure "${configure}")
+foreach(line ${configure})
+  foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_=
VERSION LIBTIFF_ALPHA_VERSION
+          LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
+    if(NOT ${var})
+      string(REGEX MATCH "^${var}=3D(.*)" ${var}_MATCH "${line}")
+      if(${var}_MATCH)
+        string(REGEX REPLACE "^${var}=3D(.*)" "\\1" ${var} "${line}")
+      endif()
+    endif()
+  endforeach()
+endforeach()
+
+math(EXPR SO_MAJOR "${LIBTIFF_CURRENT} - ${LIBTIFF_AGE}")
+set(SO_MINOR "${LIBTIFF_AGE}")
+set(SO_REVISION "${LIBTIFF_REVISION}")
+
+message(STATUS "Building tiff version ${LIBTIFF_MAJOR_VERSION}.${LIBTIFF=
_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}${LIBTIFF_ALPHA_VERSION}")
+message(STATUS "libtiff library version ${SO_MAJOR}.${SO_MINOR}.${SO_REV=
ISION}")
+
 # Project version
-project(tiff VERSION 4.0.5 LANGUAGES C)
+project(tiff VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.=
${LIBTIFF_MICRO_VERSION}" LANGUAGES C)
 # the other tiff_VERSION_* variables are set automatically
-set(tiff_VERSION_ALPHA beta)
+set(tiff_VERSION_ALPHA "${LIBTIFF_ALPHA_VERSION}")
 # Library version (unlike libtool's baroque scheme, WYSIWYG here)
-set(SO_COMPATVERSION 5)
-set(SO_VERSION 5.2.2)
+set(SO_COMPATVERSION "${SO_MAJOR}")
+set(SO_VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
=20
 # For autotools header compatibility
 set(PACKAGE_NAME "LibTIFF Software")
------=_20150831161218_61353
Content-Type: text/x-diff; name="02-cmake-shlibs.patch"
Content-Disposition: attachment; filename="02-cmake-shlibs.patch"
Content-Transfer-Encoding: quoted-printable

Index: CMakeLists.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/CMakeLists.txt,v
retrieving revision 1.5
diff -u -r1.5 CMakeLists.txt
--- CMakeLists.txt	31 Aug 2015 00:01:18 -0000	1.5
+++ CMakeLists.txt	31 Aug 2015 14:26:18 -0000
@@ -42,6 +42,8 @@
   cmake_policy(SET CMP0054 NEW)
 endif(POLICY CMP0054)
=20
+set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
+
 # Project version
 project(tiff VERSION 4.0.5 LANGUAGES C)
 # the other tiff_VERSION_* variables are set automatically
@@ -704,6 +706,7 @@
 message(STATUS "  Documentation directory:            ${LIBTIFF_DOCDIR}"=
)
 message(STATUS "  C compiler:                         ${CMAKE_C_COMPILER=
}")
 message(STATUS "  C++ compiler:                       ${CMAKE_CXX_COMPIL=
ER}")
+message(STATUS "  Build shared libraries:             ${BUILD_SHARED_LIB=
S}")
 message(STATUS "  Enable linker symbol versioning:    ${HAVE_LD_VERSION_=
SCRIPT}")
 message(STATUS "  Support Microsoft Document Imaging: ${mdi}")
 message(STATUS "  Use win32 IO:                       ${USE_WIN32_FILEIO=
}")
Index: libtiff/CMakeLists.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/CMakeLists.txt,v
retrieving revision 1.2
diff -u -r1.2 CMakeLists.txt
--- libtiff/CMakeLists.txt	14 Aug 2015 02:26:37 -0000	1.2
+++ libtiff/CMakeLists.txt	31 Aug 2015 14:26:19 -0000
@@ -114,7 +114,7 @@
                     ${CMAKE_CURRENT_BINARY_DIR}
                     ${TIFF_INCLUDES})
=20
-add_library(tiff SHARED ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HE=
ADERS}
+add_library(tiff ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HEADERS}
             ${tiff_port_SOURCES} libtiff.def)
 target_link_libraries(tiff ${TIFF_LIBRARY_DEPS})
 set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
@@ -130,15 +130,7 @@
                         "-Wl,--version-script=3D${CMAKE_CURRENT_SOURCE_D=
IR}/libtiff.map")
 endif()
=20
-add_library(tiff_static STATIC ${tiff_SOURCES} ${tiff_HEADERS})
-target_link_libraries(tiff_static ${TIFF_LIBRARY_DEPS} port)
-if (NOT WIN32)
-  # Windows static and DLL import libraries both use .lib so the
-  # static lib can't use the same name as the DLL
-  set_target_properties(tiff_static PROPERTIES OUTPUT_NAME tiff)
-endif()
-
-install(TARGETS tiff tiff_static
+install(TARGETS tiff
         RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
         LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
         ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
@@ -147,7 +139,7 @@
         DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
=20
 if(cxx)
-  add_library(tiffxx SHARED ${tiffxx_SOURCES} ${tiffxx_HEADERS})
+  add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
   target_link_libraries(tiffxx tiff)
   set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
   if(NOT CYGWIN)
@@ -162,15 +154,7 @@
                           "-Wl,--version-script=3D${CMAKE_CURRENT_SOURCE=
_DIR}/libtiffxx.map")
   endif()
=20
-  add_library(tiffxx_static STATIC ${tiffxx_SOURCES} ${tiffxx_HEADERS})
-  target_link_libraries(tiffxx_static tiff_staticport)
- if (NOT WIN32)
-    # Windows static and DLL import libraries both use .lib so the
-    # static lib can't use the same name as the DLL
-    set_target_properties(tiffxx_static PROPERTIES OUTPUT_NAME tiffxx)
-  endif()
-
-  install(TARGETS tiffxx tiffxx_static
+  install(TARGETS tiffxx
           RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
           LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
           ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
------=_20150831161218_61353
Content-Type: text/x-diff; name="03-test-dist.patch"
Content-Disposition: attachment; filename="03-test-dist.patch"
Content-Transfer-Encoding: quoted-printable

Index: test/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/test/Makefile.am,v
retrieving revision 1.38
diff -u -r1.38 Makefile.am
--- test/Makefile.am	31 Aug 2015 00:01:18 -0000	1.38
+++ test/Makefile.am	31 Aug 2015 14:30:09 -0000
@@ -39,7 +39,8 @@
 	CMakeLists.txt \
 	common.sh \
 	TiffSplitTest.cmake \
-	TiffTestCommon.cmake
+	TiffTestCommon.cmake \
+	TiffTest.cmake
=20
 # All of the tests to execute via 'make check'
 TESTS =3D $(check_PROGRAMS) $(TESTSCRIPTS)
------=_20150831161218_61353
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
------=_20150831161218_61353--




