diff options
-rw-r--r-- | CMakeLists.txt | 37 | ||||
-rw-r--r-- | LICENSE.md (renamed from COPYRIGHT) | 6 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 44 | ||||
-rw-r--r-- | contrib/addtiffo/Makefile.am | 2 | ||||
-rw-r--r-- | contrib/dbs/Makefile.am | 2 | ||||
-rw-r--r-- | contrib/iptcutil/Makefile.am | 2 | ||||
-rwxr-xr-x | libtiff/CMakeLists.txt | 26 | ||||
-rw-r--r-- | man/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | tools/Makefile.am | 4 |
11 files changed, 120 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index abd4b917..9a25d3e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,10 +42,16 @@ message(STATUS "libtiff build date: ${BUILD_DATE}") set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries") +option(tiff-tools "build TIFF tools" ON) +option(tiff-tests "build TIFF tests" ON) +option(tiff-contrib "build TIFF contrib" ON) +option(tiff-docs "build TIFF documentation" ON) +option(tiff-deprecated "build TIFF deprecated features" OFF) # Disable deprecated features to ensure clean build -add_definitions(-DTIFF_DISABLE_DEPRECATED) - +if (tiff-deprecated) + add_definitions(-DTIFF_DISABLE_DEPRECATED) +endif() # Project definition set(CMAKE_C_STANDARD 99) @@ -131,16 +137,28 @@ find_package(CMath REQUIRED) # Release support include(Release) +if(MSVC) + add_compile_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) + add_compile_options(/wd4996) +endif() # Process subdirectories add_subdirectory(port) add_subdirectory(libtiff) -add_subdirectory(tools) -add_subdirectory(test) -add_subdirectory(contrib) +if(tiff-tools) + add_subdirectory(tools) +endif() +if(tiff-tests) + add_subdirectory(test) +endif() +if(tiff-contrib) + add_subdirectory(contrib) +endif() add_subdirectory(build) -add_subdirectory(man) -add_subdirectory(doc) +if(tiff-docs) + add_subdirectory(man) + add_subdirectory(doc) +endif() # pkg-config support include(PkgConfig) @@ -153,6 +171,11 @@ message(STATUS " Documentation directory: ${LIBTIFF_DOCDIR}") message(STATUS " C compiler: ${CMAKE_C_COMPILER}") message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}") message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}") +message(STATUS " Build tools: ${tiff-tools}") +message(STATUS " Build tests: ${tiff-tests}") +message(STATUS " Build contrib: ${tiff-contrib}") +message(STATUS " Build docs: ${tiff-docs}") +message(STATUS " Build deprecated features: ${tiff-deprecated}") 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}") @@ -1,5 +1,7 @@ -Copyright (c) 1988-1997 Sam Leffler -Copyright (c) 1991-1997 Silicon Graphics, Inc. +# LibTIFF license + +Copyright © 1988-1997 Sam Leffler\ +Copyright © 1991-1997 Silicon Graphics, Inc. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided diff --git a/Makefile.am b/Makefile.am index 9b6ff94f..9f06c10b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,8 +29,8 @@ AUTOMAKE_OPTIONS = 1.12 dist-zip foreign ACLOCAL_AMFLAGS = -I m4 docfiles = \ - COPYRIGHT \ ChangeLog \ + LICENSE.md \ README.md \ RELEASE-DATE \ TODO \ @@ -44,7 +44,9 @@ EXTRA_DIST = \ autogen.sh \ libtiff-4.pc.in +if TIFF_DOCS dist_doc_DATA = $(docfiles) +endif distcheck-hook: if [ -x "$(CMAKE)" ]; then \ diff --git a/configure.ac b/configure.ac index a5b1e811..278cfcb8 100644 --- a/configure.ac +++ b/configure.ac @@ -198,8 +198,15 @@ dnl --------------------------------------------------------------------------- dnl Deprecated features and backward compatibilty dnl --------------------------------------------------------------------------- -# Disable deprecated features to ensure clean build -CPPFLAGS="-DTIFF_DISABLE_DEPRECATED $CPPFLAGS" +AC_ARG_ENABLE([deprecated], + AS_HELP_STRING([--enable-deprecated], + [enable deprecated features (default is disabled)]), + [enable_deprecated=$enableval], [enable_deprecated=no]) + +if test "$enable_deprecated" = "yes"; then + # Disable deprecated features to ensure clean build + CPPFLAGS="-DTIFF_DISABLE_DEPRECATED $CPPFLAGS" +fi dnl --------------------------------------------------------------------------- dnl Compute sized types for current CPU and compiler options @@ -316,6 +323,34 @@ fi AC_SUBST(LIBTIFF_DOCDIR) +dnl --------------------------------------------------------------------------- +dnl Enable or disable parts of the build +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(tools, + AS_HELP_STRING([--disable-tools], + [Disable building of tools]), + [TIFF_TOOLS=$enableval], [TIFF_TOOLS=yes]) +AM_CONDITIONAL(TIFF_TOOLS, test "$TIFF_TOOLS" = "yes") + +AC_ARG_ENABLE(tests, + AS_HELP_STRING([--disable-tests], + [Disable building of tests]), + [TIFF_TESTS=$enableval], [TIFF_TESTS=yes]) +AM_CONDITIONAL(TIFF_TESTS, test "$TIFF_TESTS" = "yes") + +AC_ARG_ENABLE(contrib, + AS_HELP_STRING([--disable-contrib], + [Disable building of contrib]), + [TIFF_CONTRIB=$enableval], [TIFF_CONTRIB=yes]) +AM_CONDITIONAL(TIFF_CONTRIB, test "$TIFF_CONTRIB" = "yes") + +AC_ARG_ENABLE(docs, + AS_HELP_STRING([--disable-docs], + [Disable building of docs]), + [TIFF_DOCS=$enableval], [TIFF_DOCS=yes]) +AM_CONDITIONAL(TIFF_DOCS, test "$TIFF_DOCS" = "yes") + dnl --------------------------------------------------------------------------- dnl Switch on/off internal codecs. @@ -1147,6 +1182,11 @@ LOC_MSG([ Installation directory: ${prefix}]) LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}]) LOC_MSG([ C compiler: ${CC} ${CFLAGS}]) LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}]) +LOC_MSG([ Build tools: ${TIFF_TOOLS}]) +LOC_MSG([ Build tests: ${TIFF_TESTS}]) +LOC_MSG([ Build contrib: ${TIFF_CONTRIB}]) +LOC_MSG([ Build docs: ${TIFF_DOCS}]) +LOC_MSG([ Build deprecated features: ${enable_deprecated}]) LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}]) LOC_MSG([ Enable linker symbol versioning: ${have_ld_version_script}]) LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}]) diff --git a/contrib/addtiffo/Makefile.am b/contrib/addtiffo/Makefile.am index 3f817c6f..f8f15fcd 100644 --- a/contrib/addtiffo/Makefile.am +++ b/contrib/addtiffo/Makefile.am @@ -29,7 +29,9 @@ EXTRA_DIST = \ CMakeLists.txt \ README +if TIFF_CONTRIB noinst_PROGRAMS = addtiffo +endif addtiffo_SOURCES = addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h addtiffo_LDADD = $(LIBTIFF) diff --git a/contrib/dbs/Makefile.am b/contrib/dbs/Makefile.am index 90697eed..191d9346 100644 --- a/contrib/dbs/Makefile.am +++ b/contrib/dbs/Makefile.am @@ -31,7 +31,9 @@ EXTRA_DIST = \ CMakeLists.txt \ README +if TIFF_CONTRIB noinst_PROGRAMS = tiff-bi tiff-grayscale tiff-palette tiff-rgb +endif tiff_bi_SOURCES = tiff-bi.c tiff_bi_LDADD = $(LIBTIFF) diff --git a/contrib/iptcutil/Makefile.am b/contrib/iptcutil/Makefile.am index 4aabe2e9..ca79306a 100644 --- a/contrib/iptcutil/Makefile.am +++ b/contrib/iptcutil/Makefile.am @@ -31,7 +31,9 @@ EXTRA_DIST = \ test.iptc \ test.txt +if TIFF_CONTRIB noinst_PROGRAMS = iptcutil +endif iptcutil_SOURCES = iptcutil.c iptcutil_LDADD = $(LIBTIFF) diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index b6b31677..3fab9b67 100755 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt @@ -189,7 +189,13 @@ if(CXX_SUPPORT) set(tiffxx_HEADERS tiffio.hxx) - add_library(tiffxx ../placeholder.h) + # No .def file for this library. + if (WIN32) + add_library(tiffxx STATIC ../placeholder.h) + else() + add_library(tiffxx ../placeholder.h) + endif() + target_sources(tiffxx PRIVATE ${tiffxx_HEADERS} tif_stream.cxx) @@ -217,12 +223,14 @@ if(CXX_SUPPORT) endif() -add_executable(mkg3states ../placeholder.h) -target_sources(mkg3states PRIVATE mkg3states.c tif_fax3.h) -target_link_libraries(mkg3states tiff port) +if(NOT CMAKE_CROSSCOMPILING) + add_executable(mkg3states ../placeholder.h) + target_sources(mkg3states PRIVATE mkg3states.c tif_fax3.h) + target_link_libraries(mkg3states tiff port) -add_custom_target(faxtable - DEPENDS mkg3states - COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c" - COMMAND mkg3states -b -c const "tif_fax3sm.c" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + add_custom_target(faxtable + DEPENDS mkg3states + COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c" + COMMAND mkg3states -b -c const "tif_fax3sm.c" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") +endif() diff --git a/man/Makefile.am b/man/Makefile.am index 0fe9e4d0..7cc14608 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -23,7 +23,7 @@ # Process this file with automake to produce Makefile.in. -dist_man1_MANS = \ +man1_pages = \ fax2ps.1 \ fax2tiff.1 \ pal2rgb.1 \ @@ -44,7 +44,7 @@ dist_man1_MANS = \ tiffset.1 \ tiffsplit.1 -dist_man3_MANS = \ +man3_pages = \ libtiff.3tiff \ TIFFbuffer.3tiff \ TIFFClose.3tiff \ @@ -90,5 +90,13 @@ dist_man3_MANS = \ TIFFWriteScanline.3tiff \ TIFFWriteTile.3tiff +if TIFF_DOCS +man1_MANS = $(man1_pages) +man3_MANS = $(man3_pages) +endif + + EXTRA_DIST = \ + $(man1_pages) \ + $(man3_pages) \ CMakeLists.txt diff --git a/test/Makefile.am b/test/Makefile.am index b5823198..6df12122 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -44,7 +44,9 @@ EXTRA_DIST = \ TiffTest.cmake # All of the tests to execute via 'make check' +if TIFF_TESTS TESTS = $(check_PROGRAMS) $(TESTSCRIPTS) +endif # Tests which are expected to fail XFAIL_TESTS = @@ -66,10 +68,12 @@ JPEG_DEPENDENT_TESTSCRIPTS= endif # Executable programs which need to be built in order to support tests +if TIFF_TESTS check_PROGRAMS = \ ascii_tag long_tag short_tag strip_rw rewrite custom_dir custom_dir_EXIF_231 \ rational_precision2double defer_strile_loading defer_strile_writing test_directory \ testtypes test_signed_tags $(JPEG_DEPENDENT_CHECK_PROG) +endif # Test scripts to execute TESTSCRIPTS = \ diff --git a/tools/Makefile.am b/tools/Makefile.am index c8142b05..c6c4c8af 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -29,6 +29,7 @@ LIBTIFF = $(top_builddir)/libtiff/libtiff.la EXTRA_DIST = \ CMakeLists.txt +if TIFF_TOOLS bin_PROGRAMS = \ fax2ps \ fax2tiff \ @@ -51,13 +52,16 @@ bin_PROGRAMS = \ if HAVE_OPENGL bin_PROGRAMS += tiffgt endif +endif EXTRA_PROGRAMS = rgb2ycbcr thumbnail # Executable programs which need to be built in order to support tests +if TIFF_TESTS check_PROGRAMS = \ rgb2ycbcr \ thumbnail +endif if HAVE_RPATH AM_LDFLAGS = $(LIBDIR) |