Blame CMakeLists.txt

Packit Service 2594b8
# CMake build for libtiff
Packit Service 2594b8
# Run "cmake" to generate the build files for your platform
Packit Service 2594b8
#
Packit Service 2594b8
# Copyright © 2015 Open Microscopy Environment / University of Dundee
Packit Service 2594b8
# Written by Roger Leigh <rleigh@codelibre.net>
Packit Service 2594b8
#
Packit Service 2594b8
# Permission to use, copy, modify, distribute, and sell this software and
Packit Service 2594b8
# its documentation for any purpose is hereby granted without fee, provided
Packit Service 2594b8
# that (i) the above copyright notices and this permission notice appear in
Packit Service 2594b8
# all copies of the software and related documentation, and (ii) the names of
Packit Service 2594b8
# Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit Service 2594b8
# publicity relating to the software without the specific, prior written
Packit Service 2594b8
# permission of Sam Leffler and Silicon Graphics.
Packit Service 2594b8
#
Packit Service 2594b8
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
Packit Service 2594b8
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
Packit Service 2594b8
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 2594b8
#
Packit Service 2594b8
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit Service 2594b8
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit Service 2594b8
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit Service 2594b8
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
Packit Service 2594b8
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
Packit Service 2594b8
# OF THIS SOFTWARE.
Packit Service 2594b8
Packit Service 2594b8
cmake_minimum_required(VERSION 2.8.9)
Packit Service 2594b8
Packit Service 2594b8
# Default policy is from 2.8.9
Packit Service 2594b8
cmake_policy(VERSION 2.8.9)
Packit Service 2594b8
# Set MacOSX @rpath usage globally.
Packit Service 2594b8
if (POLICY CMP0020)
Packit Service 2594b8
  cmake_policy(SET CMP0020 NEW)
Packit Service 2594b8
endif(POLICY CMP0020)
Packit Service 2594b8
if (POLICY CMP0042)
Packit Service 2594b8
  cmake_policy(SET CMP0042 NEW)
Packit Service 2594b8
endif(POLICY CMP0042)
Packit Service 2594b8
# Use new variable expansion policy.
Packit Service 2594b8
if (POLICY CMP0053)
Packit Service 2594b8
  cmake_policy(SET CMP0053 NEW)
Packit Service 2594b8
endif(POLICY CMP0053)
Packit Service 2594b8
if (POLICY CMP0054)
Packit Service 2594b8
  cmake_policy(SET CMP0054 NEW)
Packit Service 2594b8
endif(POLICY CMP0054)
Packit Service 2594b8
Packit Service 2594b8
# Read version information from configure.ac.
Packit Service 2594b8
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure)
Packit Service 2594b8
STRING(REGEX REPLACE ";" "\\\\;" configure "${configure}")
Packit Service 2594b8
STRING(REGEX REPLACE "\n" ";" configure "${configure}")
Packit Service 2594b8
foreach(line ${configure})
Packit Service 2594b8
  foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_VERSION LIBTIFF_ALPHA_VERSION
Packit Service 2594b8
          LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
Packit Service 2594b8
    if(NOT ${var})
Packit Service 2594b8
      string(REGEX MATCH "^${var}=(.*)" ${var}_MATCH "${line}")
Packit Service 2594b8
      if(${var}_MATCH)
Packit Service 2594b8
        string(REGEX REPLACE "^${var}=(.*)" "\\1" ${var} "${line}")
Packit Service 2594b8
      endif()
Packit Service 2594b8
    endif()
Packit Service 2594b8
  endforeach()
Packit Service 2594b8
endforeach()
Packit Service 2594b8
Packit Service 2594b8
math(EXPR SO_MAJOR "${LIBTIFF_CURRENT} - ${LIBTIFF_AGE}")
Packit Service 2594b8
set(SO_MINOR "${LIBTIFF_AGE}")
Packit Service 2594b8
set(SO_REVISION "${LIBTIFF_REVISION}")
Packit Service 2594b8
Packit Service 2594b8
message(STATUS "Building tiff version ${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}${LIBTIFF_ALPHA_VERSION}")
Packit Service 2594b8
message(STATUS "libtiff library version ${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
Packit Service 2594b8
Packit Service 2594b8
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
Packit Service 2594b8
Packit Service 2594b8
# Project version
Packit Service 2594b8
project(tiff C)
Packit Service 2594b8
set(VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}")
Packit Service 2594b8
set(tiff_VERSION "${VERSION}")
Packit Service 2594b8
set(tiff_VERSION_MAJOR "${LIBTIFF_MAJOR_VERSION}")
Packit Service 2594b8
set(tiff_VERSION_MINOR "${LIBTIFF_MINOR_VERSION}")
Packit Service 2594b8
set(tiff_VERSION_PATCH "${LIBTIFF_MICRO_VERSION}")
Packit Service 2594b8
Packit Service 2594b8
# the other tiff_VERSION_* variables are set automatically
Packit Service 2594b8
set(tiff_VERSION_ALPHA "${LIBTIFF_ALPHA_VERSION}")
Packit Service 2594b8
# Library version (unlike libtool's baroque scheme, WYSIWYG here)
Packit Service 2594b8
set(SO_COMPATVERSION "${SO_MAJOR}")
Packit Service 2594b8
set(SO_VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
Packit Service 2594b8
Packit Service 2594b8
# For autotools header compatibility
Packit Service 2594b8
set(PACKAGE_NAME "LibTIFF Software")
Packit Service 2594b8
set(PACKAGE_TARNAME "${PROJECT_NAME}")
Packit Service 2594b8
set(PACKAGE_VERSION "${PROJECT_VERSION}${tiff_VERSION_ALPHA}")
Packit Service 2594b8
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
Packit Service 2594b8
set(PACKAGE_BUGREPORT "tiff@lists.maptools.org")
Packit Service 2594b8
Packit Service 2594b8
include(GNUInstallDirs)
Packit Service 2594b8
include(CheckCCompilerFlag)
Packit Service 2594b8
include(CheckCSourceCompiles)
Packit Service 2594b8
include(CheckIncludeFile)
Packit Service 2594b8
include(CheckTypeSize)
Packit Service 2594b8
include(CheckFunctionExists)
Packit Service 2594b8
enable_testing()
Packit Service 2594b8
Packit Service 2594b8
macro(current_date var)
Packit Service 2594b8
  if(UNIX)
Packit Service 2594b8
    execute_process(COMMAND "date" +"%Y%m%d" OUTPUT_VARIABLE ${var})
Packit Service 2594b8
  endif()
Packit Service 2594b8
endmacro()
Packit Service 2594b8
Packit Service 2594b8
current_date(RELEASE_DATE)
Packit Service 2594b8
Packit Service 2594b8
macro(extra_dist)
Packit Service 2594b8
  foreach(file ${ARGV})
Packit Service 2594b8
    file(RELATIVE_PATH relfile "${PROJECT_SOURCE_DIR}"
Packit Service 2594b8
         "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
Packit Service 2594b8
    list(APPEND EXTRA_DIST "${relfile}")
Packit Service 2594b8
  endforeach()
Packit Service 2594b8
  set(EXTRA_DIST "${EXTRA_DIST}" PARENT_SCOPE)
Packit Service 2594b8
endmacro()
Packit Service 2594b8
Packit Service 2594b8
set(EXTRA_DIST
Packit Service 2594b8
  HOWTO-RELEASE
Packit Service 2594b8
  Makefile.vc
Packit Service 2594b8
  SConstruct
Packit Service 2594b8
  autogen.sh
Packit Service 2594b8
  configure.com
Packit Service 2594b8
  nmake.opt
Packit Service 2594b8
  libtiff-4.pc.in)
Packit Service 2594b8
Packit Service 2594b8
# These are annoyingly verbose, produce false positives or don't work
Packit Service 2594b8
# nicely with all supported compiler versions, so are disabled unless
Packit Service 2594b8
# explicitly enabled.
Packit Service 2594b8
option(extra-warnings "Enable extra compiler warnings" OFF)
Packit Service 2594b8
Packit Service 2594b8
# This will cause the compiler to fail when an error occurs.
Packit Service 2594b8
option(fatal-warnings "Compiler warnings are errors" OFF)
Packit Service 2594b8
Packit Service 2594b8
# Check if the compiler supports each of the following additional
Packit Service 2594b8
# flags, and enable them if supported.  This greatly improves the
Packit Service 2594b8
# quality of the build by checking for a number of common problems,
Packit Service 2594b8
# some of which are quite serious.
Packit Service 2594b8
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
Packit Service 2594b8
   CMAKE_C_COMPILER_ID MATCHES "Clang")
Packit Service 2594b8
  set(test_flags
Packit Service 2594b8
      -Wall
Packit Service 2594b8
      -Winline
Packit Service 2594b8
      -W
Packit Service 2594b8
      -Wformat-security
Packit Service 2594b8
      -Wpointer-arith
Packit Service 2594b8
      -Wdisabled-optimization
Packit Service 2594b8
      -Wno-unknown-pragmas
Packit Service 2594b8
      -Wdeclaration-after-statement
Packit Service 2594b8
      -fstrict-aliasing)
Packit Service 2594b8
  if(extra-warnings)
Packit Service 2594b8
    list(APPEND test_flags
Packit Service 2594b8
        -Wfloat-equal
Packit Service 2594b8
        -Wmissing-prototypes
Packit Service 2594b8
        -Wunreachable-code)
Packit Service 2594b8
  endif()
Packit Service 2594b8
  if(fatal-warnings)
Packit Service 2594b8
    list(APPEND test_flags
Packit Service 2594b8
         -Werror)
Packit Service 2594b8
  endif()
Packit Service 2594b8
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
Packit Service 2594b8
  set(test_flags)
Packit Service 2594b8
  if(extra-warnings)
Packit Service 2594b8
    list(APPEND test_flags
Packit Service 2594b8
         /W4)
Packit Service 2594b8
  else()
Packit Service 2594b8
    list(APPEND test_flags
Packit Service 2594b8
         /W3)
Packit Service 2594b8
  endif()
Packit Service 2594b8
  if (fatal-warnings)
Packit Service 2594b8
    list(APPEND test_flags
Packit Service 2594b8
         /WX)
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
foreach(flag ${test_flags})
Packit Service 2594b8
  string(REGEX REPLACE "[^A-Za-z0-9]" "_" flag_var "${flag}")
Packit Service 2594b8
  set(test_c_flag "C_FLAG${flag_var}")
Packit Service 2594b8
  CHECK_C_COMPILER_FLAG(${flag} "${test_c_flag}")
Packit Service 2594b8
  if (${test_c_flag})
Packit Service 2594b8
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
Packit Service 2594b8
  endif (${test_c_flag})
Packit Service 2594b8
endforeach(flag ${test_flags})
Packit Service 2594b8
Packit Service 2594b8
if(MSVC)
Packit Service 2594b8
    set(CMAKE_DEBUG_POSTFIX "d")
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
option(ld-version-script "Enable linker version script" ON)
Packit Service 2594b8
# Check if LD supports linker scripts.
Packit Service 2594b8
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
Packit Service 2594b8
        global: sym;
Packit Service 2594b8
};
Packit Service 2594b8
Packit Service 2594b8
VERS_2 {
Packit Service 2594b8
        global: sym;
Packit Service 2594b8
} VERS_1;
Packit Service 2594b8
")
Packit Service 2594b8
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
Packit Service 2594b8
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
Packit Service 2594b8
check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT)
Packit Service 2594b8
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
Packit Service 2594b8
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
Packit Service 2594b8
if (ld-version-script AND HAVE_LD_VERSION_SCRIPT)
Packit Service 2594b8
  set(HAVE_LD_VERSION_SCRIPT TRUE)
Packit Service 2594b8
else()
Packit Service 2594b8
  set(HAVE_LD_VERSION_SCRIPT FALSE)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Find libm, if available
Packit Service 2594b8
find_library(M_LIBRARY m)
Packit Service 2594b8
Packit Service 2594b8
check_include_file(assert.h    HAVE_ASSERT_H)
Packit Service 2594b8
check_include_file(dlfcn.h     HAVE_DLFCN_H)
Packit Service 2594b8
check_include_file(fcntl.h     HAVE_FCNTL_H)
Packit Service 2594b8
check_include_file(inttypes.h  HAVE_INTTYPES_H)
Packit Service 2594b8
check_include_file(io.h        HAVE_IO_H)
Packit Service 2594b8
check_include_file(limits.h    HAVE_LIMITS_H)
Packit Service 2594b8
check_include_file(malloc.h    HAVE_MALLOC_H)
Packit Service 2594b8
check_include_file(memory.h    HAVE_MEMORY_H)
Packit Service 2594b8
check_include_file(search.h    HAVE_SEARCH_H)
Packit Service 2594b8
check_include_file(stdint.h    HAVE_STDINT_H)
Packit Service 2594b8
check_include_file(string.h    HAVE_STRING_H)
Packit Service 2594b8
check_include_file(strings.h   HAVE_STRINGS_H)
Packit Service 2594b8
check_include_file(sys/time.h  HAVE_SYS_TIME_H)
Packit Service 2594b8
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
Packit Service 2594b8
check_include_file(unistd.h    HAVE_UNISTD_H)
Packit Service 2594b8
Packit Service 2594b8
# Inspired from /usr/share/autoconf/autoconf/c.m4
Packit Service 2594b8
foreach(inline_keyword "inline" "__inline__" "__inline")
Packit Service 2594b8
  if(NOT DEFINED C_INLINE)
Packit Service 2594b8
    set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
Packit Service 2594b8
    set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
Packit Service 2594b8
        "-Dinline=${inline_keyword}")
Packit Service 2594b8
    check_c_source_compiles("
Packit Service 2594b8
        typedef int foo_t;
Packit Service 2594b8
        static inline foo_t static_foo() {return 0;}
Packit Service 2594b8
        foo_t foo(){return 0;}
Packit Service 2594b8
        int main(int argc, char *argv[]) {return 0;}"
Packit Service 2594b8
      C_HAS_${inline_keyword})
Packit Service 2594b8
    set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
Packit Service 2594b8
    if(C_HAS_${inline_keyword})
Packit Service 2594b8
      set(C_INLINE TRUE)
Packit Service 2594b8
      set(INLINE_KEYWORD "${inline_keyword}")
Packit Service 2594b8
    endif()
Packit Service 2594b8
 endif()
Packit Service 2594b8
endforeach()
Packit Service 2594b8
if(NOT DEFINED C_INLINE)
Packit Service 2594b8
  set(INLINE_KEYWORD)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# off_t and size_t checks omitted; not clear they are used at all
Packit Service 2594b8
# Are off_t and size_t checks strictly necessary?
Packit Service 2594b8
Packit Service 2594b8
# Check if sys/time.h and time.h allow use together
Packit Service 2594b8
check_c_source_compiles("
Packit Service 2594b8
#include <sys/time.h>
Packit Service 2594b8
#include <time.h>
Packit Service 2594b8
int main(void){return 0;}"
Packit Service 2594b8
  TIME_WITH_SYS_TIME)
Packit Service 2594b8
Packit Service 2594b8
# Check if struct tm is in sys/time.h
Packit Service 2594b8
check_c_source_compiles("
Packit Service 2594b8
#include <sys/types.h>
Packit Service 2594b8
#include <time.h>
Packit Service 2594b8
Packit Service 2594b8
int main(void){
Packit Service 2594b8
  struct tm tm;
Packit Service 2594b8
  int *p = &tm.tm_sec;
Packit Service 2594b8
  return !p;
Packit Service 2594b8
}"
Packit Service 2594b8
  TM_IN_SYS_TIME)
Packit Service 2594b8
Packit Service 2594b8
# Check type sizes
Packit Service 2594b8
# NOTE: Could be replaced with C99 <stdint.h>
Packit Service 2594b8
check_type_size("signed short" SIZEOF_SIGNED_SHORT)
Packit Service 2594b8
check_type_size("unsigned short" SIZEOF_UNSIGNED_SHORT)
Packit Service 2594b8
check_type_size("signed int" SIZEOF_SIGNED_INT)
Packit Service 2594b8
check_type_size("unsigned int" SIZEOF_UNSIGNED_INT)
Packit Service 2594b8
check_type_size("signed long" SIZEOF_SIGNED_LONG)
Packit Service 2594b8
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
Packit Service 2594b8
check_type_size("signed long long" SIZEOF_SIGNED_LONG_LONG)
Packit Service 2594b8
check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
Packit Service 2594b8
check_type_size("unsigned char *" SIZEOF_UNSIGNED_CHAR_P)
Packit Service 2594b8
Packit Service 2594b8
set(CMAKE_EXTRA_INCLUDE_FILES_SAVE ${CMAKE_EXTRA_INCLUDE_FILES})
Packit Service 2594b8
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "stddef.h")
Packit Service 2594b8
check_type_size("size_t" SIZEOF_SIZE_T)
Packit Service 2594b8
check_type_size("ptrdiff_t" SIZEOF_PTRDIFF_T)
Packit Service 2594b8
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_SAVE})
Packit Service 2594b8
Packit Service 2594b8
macro(report_values)
Packit Service 2594b8
  foreach(val ${ARGV})
Packit Service 2594b8
    message(STATUS "${val} set to ${${val}}")
Packit Service 2594b8
  endforeach()
Packit Service 2594b8
endmacro()
Packit Service 2594b8
Packit Service 2594b8
set(TIFF_INT8_T "signed char")
Packit Service 2594b8
set(TIFF_UINT8_T "unsigned char")
Packit Service 2594b8
Packit Service 2594b8
set(TIFF_INT16_T "signed short")
Packit Service 2594b8
set(TIFF_UINT16_T "unsigned short")
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_SIGNED_INT EQUAL 4)
Packit Service 2594b8
  set(TIFF_INT32_T "signed int")
Packit Service 2594b8
  set(TIFF_INT32_FORMAT "%d")
Packit Service 2594b8
elseif(SIZEOF_SIGNED_LONG EQUAL 4)
Packit Service 2594b8
  set(TIFF_INT32_T "signed long")
Packit Service 2594b8
  set(TIFF_INT32_FORMAT "%ld")
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_UNSIGNED_INT EQUAL 4)
Packit Service 2594b8
  set(TIFF_UINT32_T "unsigned int")
Packit Service 2594b8
  set(TIFF_UINT32_FORMAT "%u")
Packit Service 2594b8
elseif(SIZEOF_UNSIGNED_LONG EQUAL 4)
Packit Service 2594b8
  set(TIFF_UINT32_T "unsigned long")
Packit Service 2594b8
  set(TIFF_UINT32_FORMAT "%lu")
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_SIGNED_LONG EQUAL 8)
Packit Service 2594b8
  set(TIFF_INT64_T "signed long")
Packit Service 2594b8
  set(TIFF_INT64_FORMAT "%ld")
Packit Service 2594b8
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL 8)
Packit Service 2594b8
  set(TIFF_INT64_T "signed long long")
Packit Service 2594b8
  if (MINGW)
Packit Service 2594b8
    set(TIFF_INT64_FORMAT "%I64d")
Packit Service 2594b8
  else()
Packit Service 2594b8
    set(TIFF_INT64_FORMAT "%lld")
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_UNSIGNED_LONG EQUAL 8)
Packit Service 2594b8
  set(TIFF_UINT64_T "unsigned long")
Packit Service 2594b8
  set(TIFF_UINT64_FORMAT "%lu")
Packit Service 2594b8
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL 8)
Packit Service 2594b8
  set(TIFF_UINT64_T "unsigned long long")
Packit Service 2594b8
  if (MINGW)
Packit Service 2594b8
    set(TIFF_UINT64_FORMAT "%I64u")
Packit Service 2594b8
  else()
Packit Service 2594b8
    set(TIFF_UINT64_FORMAT "%llu")
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
Packit Service 2594b8
  set(TIFF_SIZE_T "unsigned int")
Packit Service 2594b8
  set(TIFF_SIZE_FORMAT "%u")
Packit Service 2594b8
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
Packit Service 2594b8
  set(TIFF_SIZE_T "unsigned long")
Packit Service 2594b8
  set(TIFF_SIZE_FORMAT "%lu")
Packit Service 2594b8
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
Packit Service 2594b8
  set(TIFF_SIZE_T "unsigned long")
Packit Service 2594b8
  if (MINGW)
Packit Service 2594b8
    set(TIFF_SIZE_FORMAT "%I64u")
Packit Service 2594b8
  else()
Packit Service 2594b8
    set(TIFF_SIZE_FORMAT "%llu")
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
Packit Service 2594b8
  set(TIFF_SSIZE_T "signed int")
Packit Service 2594b8
  set(TIFF_SSIZE_FORMAT "%d")
Packit Service 2594b8
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
Packit Service 2594b8
  set(TIFF_SSIZE_T "signed long")
Packit Service 2594b8
  set(TIFF_SSIZE_FORMAT "%ld")
Packit Service 2594b8
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
Packit Service 2594b8
  set(TIFF_SSIZE_T "signed long long")
Packit Service 2594b8
  if (MINGW)
Packit Service 2594b8
    set(TIFF_SSIZE_FORMAT "%I64d")
Packit Service 2594b8
  else()
Packit Service 2594b8
    set(TIFF_SSIZE_FORMAT "%lld")
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
if(NOT SIZEOF_PTRDIFF_T)
Packit Service 2594b8
  set(TIFF_PTRDIFF_T "${TIFF_SSIZE_T}")
Packit Service 2594b8
  set(TIFF_PTRDIFF_FORMAT "${SSIZE_FORMAT}")
Packit Service 2594b8
else()
Packit Service 2594b8
  set(TIFF_PTRDIFF_T "ptrdiff_t")
Packit Service 2594b8
  set(TIFF_PTRDIFF_FORMAT "%ld")
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
#report_values(TIFF_INT8_T TIFF_INT8_FORMAT
Packit Service 2594b8
#              TIFF_UINT8_T TIFF_UINT8_FORMAT
Packit Service 2594b8
#              TIFF_INT16_T TIFF_INT16_FORMAT
Packit Service 2594b8
#              TIFF_UINT16_T TIFF_UINT16_FORMAT
Packit Service 2594b8
#              TIFF_INT32_T TIFF_INT32_FORMAT
Packit Service 2594b8
#              TIFF_UINT32_T TIFF_UINT32_FORMAT
Packit Service 2594b8
#              TIFF_INT64_T TIFF_INT64_FORMAT
Packit Service 2594b8
#              TIFF_UINT64_T TIFF_UINT64_FORMAT
Packit Service 2594b8
#              TIFF_SSIZE_T TIFF_SSIZE_FORMAT
Packit Service 2594b8
#              TIFF_PTRDIFF_T TIFF_PTRDIFF_FORMAT)
Packit Service 2594b8
Packit Service 2594b8
# Nonstandard int types
Packit Service 2594b8
check_type_size(INT8 int8)
Packit Service 2594b8
set(HAVE_INT8 ${INT8})
Packit Service 2594b8
check_type_size(INT16 int16)
Packit Service 2594b8
set(HAVE_INT16 ${INT16})
Packit Service 2594b8
check_type_size(INT32 int32)
Packit Service 2594b8
set(HAVE_INT32 ${INT32})
Packit Service 2594b8
Packit Service 2594b8
# Check functions
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${M_LIBRARY})
Packit Service 2594b8
check_function_exists(floor HAVE_FLOOR)
Packit Service 2594b8
check_function_exists(pow   HAVE_POW)
Packit Service 2594b8
check_function_exists(sqrt  HAVE_SQRT)
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
Packit Service 2594b8
Packit Service 2594b8
check_function_exists(isascii    HAVE_ISASCII)
Packit Service 2594b8
check_function_exists(memmove    HAVE_MEMMOVE)
Packit Service 2594b8
check_function_exists(memset     HAVE_MEMSET)
Packit Service 2594b8
check_function_exists(mmap       HAVE_MMAP)
Packit Service 2594b8
check_function_exists(setmode    HAVE_SETMODE)
Packit Service 2594b8
check_function_exists(strcasecmp HAVE_STRCASECMP)
Packit Service 2594b8
check_function_exists(strchr     HAVE_STRCHR)
Packit Service 2594b8
check_function_exists(strrchr    HAVE_STRRCHR)
Packit Service 2594b8
check_function_exists(strstr     HAVE_STRSTR)
Packit Service 2594b8
check_function_exists(strtol     HAVE_STRTOL)
Packit Service 2594b8
check_function_exists(strtol     HAVE_STRTOUL)
Packit Service 2594b8
check_function_exists(strtoull   HAVE_STRTOULL)
Packit Service 2594b8
check_function_exists(getopt     HAVE_GETOPT)
Packit Service 2594b8
check_function_exists(lfind      HAVE_LFIND)
Packit Service 2594b8
Packit Service 2594b8
# May be inlined, so check it compiles:
Packit Service 2594b8
check_c_source_compiles("
Packit Service 2594b8
#include <stdio.h>
Packit Service 2594b8
int main(void) {
Packit Service 2594b8
  char buf[10];
Packit Service 2594b8
  snprintf(buf, 10, \"Test %d\", 1);
Packit Service 2594b8
  return 0;
Packit Service 2594b8
}"
Packit Service 2594b8
  HAVE_SNPRINTF)
Packit Service 2594b8
Packit Service 2594b8
if(NOT HAVE_SNPRINTF)
Packit Service 2594b8
  add_definitions(-DNEED_LIBPORT)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# CPU bit order
Packit Service 2594b8
set(fillorder FILLORDER_MSB2LSB)
Packit Service 2594b8
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
Packit Service 2594b8
   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
Packit Service 2594b8
   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
Packit Service 2594b8
  set(fillorder FILLORDER_LSB2MSB)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(HOST_FILLORDER ${fillorder} CACHE STRING "Native CPU bit order")
Packit Service 2594b8
mark_as_advanced(HOST_FILLORDER)
Packit Service 2594b8
Packit Service 2594b8
# CPU endianness
Packit Service 2594b8
include(TestBigEndian)
Packit Service 2594b8
test_big_endian(bigendian)
Packit Service 2594b8
if (bigendian)
Packit Service 2594b8
  set(bigendian ON)
Packit Service 2594b8
else()
Packit Service 2594b8
  set(bigendian OFF)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(HOST_BIG_ENDIAN ${bigendian} CACHE STRING "Native CPU bit order")
Packit Service 2594b8
mark_as_advanced(HOST_BIG_ENDIAN)
Packit Service 2594b8
if (HOST_BIG_ENDIAN)
Packit Service 2594b8
  set(HOST_BIG_ENDIAN 1)
Packit Service 2594b8
else()
Packit Service 2594b8
  set(HOST_BIG_ENDIAN 0)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# IEEE floating point
Packit Service 2594b8
set(HAVE_IEEEFP 1 CACHE STRING "IEEE floating point is available")
Packit Service 2594b8
mark_as_advanced(HAVE_IEEEFP)
Packit Service 2594b8
Packit Service 2594b8
report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER
Packit Service 2594b8
              HOST_BIG_ENDIAN HAVE_IEEEFP)
Packit Service 2594b8
Packit Service 2594b8
# Large file support
Packit Service 2594b8
if (UNIX OR MINGW)
Packit Service 2594b8
  # This might not catch every possibility catered for by
Packit Service 2594b8
  # AC_SYS_LARGEFILE.
Packit Service 2594b8
  add_definitions(-D_FILE_OFFSET_BITS=64)
Packit Service 2594b8
  set(FILE_OFFSET_BITS 64)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Documentation install directory (default to cmake project docdir)
Packit Service 2594b8
set(LIBTIFF_DOCDIR "${CMAKE_INSTALL_FULL_DOCDIR}")
Packit Service 2594b8
Packit Service 2594b8
# Options to enable and disable internal codecs
Packit Service 2594b8
Packit Service 2594b8
option(ccitt "support for CCITT Group 3 & 4 algorithms" ON)
Packit Service 2594b8
set(CCITT_SUPPORT ${ccitt})
Packit Service 2594b8
Packit Service 2594b8
option(packbits "support for Macintosh PackBits algorithm" ON)
Packit Service 2594b8
set(PACKBITS_SUPPORT ${packbits})
Packit Service 2594b8
Packit Service 2594b8
option(lzw "support for LZW algorithm" ON)
Packit Service 2594b8
set(LZW_SUPPORT ${lzw})
Packit Service 2594b8
Packit Service 2594b8
option(thunder "support for ThunderScan 4-bit RLE algorithm" ON)
Packit Service 2594b8
set(THUNDER_SUPPORT ${thunder})
Packit Service 2594b8
Packit Service 2594b8
option(next "support for NeXT 2-bit RLE algorithm" ON)
Packit Service 2594b8
set(NEXT_SUPPORT ${next})
Packit Service 2594b8
Packit Service 2594b8
option(logluv "support for LogLuv high dynamic range algorithm" ON)
Packit Service 2594b8
set(LOGLUV_SUPPORT ${logluv})
Packit Service 2594b8
Packit Service 2594b8
# Option for Microsoft Document Imaging
Packit Service 2594b8
option(mdi "support for Microsoft Document Imaging" ON)
Packit Service 2594b8
set(MDI_SUPPORT ${mdi})
Packit Service 2594b8
Packit Service 2594b8
# ZLIB
Packit Service 2594b8
option(zlib "use zlib (required for Deflate compression)" ON)
Packit Service 2594b8
if (zlib)
Packit Service 2594b8
  find_package(ZLIB)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(ZLIB_SUPPORT 0)
Packit Service 2594b8
if(ZLIB_FOUND)
Packit Service 2594b8
  set(ZLIB_SUPPORT 1)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(ZIP_SUPPORT ${ZLIB_SUPPORT})
Packit Service 2594b8
# Option for Pixar log-format algorithm
Packit Service 2594b8
Packit Service 2594b8
# Pixar log format
Packit Service 2594b8
option(pixarlog "support for Pixar log-format algorithm (requires Zlib)" ON)
Packit Service 2594b8
set(PIXARLOG_SUPPORT FALSE)
Packit Service 2594b8
if (ZLIB_SUPPORT)
Packit Service 2594b8
  if(pixarlog)
Packit Service 2594b8
    set(PIXARLOG_SUPPORT TRUE)
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# JPEG
Packit Service 2594b8
option(jpeg "use libjpeg (required for JPEG compression)" ON)
Packit Service 2594b8
if (jpeg)
Packit Service 2594b8
  find_package(JPEG)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(JPEG_SUPPORT FALSE)
Packit Service 2594b8
if(JPEG_FOUND)
Packit Service 2594b8
  set(JPEG_SUPPORT TRUE)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
option(old-jpeg "support for Old JPEG compression (read-only)" ON)
Packit Service 2594b8
set(OJPEG_SUPPORT FALSE)
Packit Service 2594b8
if (JPEG_SUPPORT)
Packit Service 2594b8
  if (old-jpeg)
Packit Service 2594b8
    set(OJPEG_SUPPORT TRUE)
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# JBIG-KIT
Packit Service 2594b8
option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON)
Packit Service 2594b8
if (jbig)
Packit Service 2594b8
  set(JBIG_FOUND 0)
Packit Service 2594b8
  find_path(JBIG_INCLUDE_DIR jbig.h)
Packit Service 2594b8
  set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig)
Packit Service 2594b8
  find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES})
Packit Service 2594b8
  if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY)
Packit Service 2594b8
    set(JBIG_FOUND 1)
Packit Service 2594b8
    set(JBIG_LIBRARIES ${JBIG_LIBRARY})
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
set(JBIG_SUPPORT 0)
Packit Service 2594b8
if(JBIG_FOUND)
Packit Service 2594b8
  set(JBIG_FOUND TRUE)
Packit Service 2594b8
  set(JBIG_SUPPORT 1)
Packit Service 2594b8
else()
Packit Service 2594b8
  set(JBIG_FOUND FALSE)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
Packit Service 2594b8
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
Packit Service 2594b8
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR})
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY})
Packit Service 2594b8
check_function_exists(jbg_newlen HAVE_JBG_NEWLEN)
Packit Service 2594b8
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
Packit Service 2594b8
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
Packit Service 2594b8
Packit Service 2594b8
# liblzma2
Packit Service 2594b8
option(lzma "use liblzma (required for LZMA2 compression)" ON)
Packit Service 2594b8
if (lzma)
Packit Service 2594b8
  find_package(LibLZMA)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(LZMA_SUPPORT 0)
Packit Service 2594b8
if(LIBLZMA_FOUND)
Packit Service 2594b8
  set(LZMA_SUPPORT 1)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# 8/12-bit jpeg mode
Packit Service 2594b8
option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate
Packit Service 2594b8
12-bit libjpeg build)" ON)
Packit Service 2594b8
set(JPEG12_INCLUDE_DIR JPEG12_INCLUDE_DIR-NOTFOUND CACHE PATH "Include directory for 12-bit libjpeg")
Packit Service 2594b8
set(JPEG12_LIBRARY JPEG12_LIBRARY-NOTFOUND CACHE FILEPATH "12-bit libjpeg library")
Packit Service 2594b8
set(JPEG12_FOUND FALSE)
Packit Service 2594b8
if (JPEG12_INCLUDE_DIR AND JPEG12_LIBRARY)
Packit Service 2594b8
  set(JPEG12_LIBRARIES ${JPEG12_LIBRARY})
Packit Service 2594b8
  set(JPEG12_FOUND TRUE)
Packit Service 2594b8
endif()
Packit Service 2594b8
if (JPEG12_FOUND)
Packit Service 2594b8
  set(JPEG_DUAL_MODE_8_12 1)
Packit Service 2594b8
  set(LIBJPEG_12_PATH "${JPEG12_INCLUDE_DIR}/jpeglib.h")
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# C++ support
Packit Service 2594b8
option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
Packit Service 2594b8
set(CXX_SUPPORT FALSE)
Packit Service 2594b8
if (cxx)
Packit Service 2594b8
  enable_language(CXX)
Packit Service 2594b8
  set(CXX_SUPPORT TRUE)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# OpenGL and GLUT
Packit Service 2594b8
find_package(OpenGL)
Packit Service 2594b8
find_package(GLUT)
Packit Service 2594b8
set(HAVE_OPENGL FALSE)
Packit Service 2594b8
if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
Packit Service 2594b8
  set(HAVE_OPENGL TRUE)
Packit Service 2594b8
endif()
Packit Service 2594b8
# Purely to satisfy the generated headers:
Packit Service 2594b8
check_include_file(GL/gl.h HAVE_GL_GL_H)
Packit Service 2594b8
check_include_file(GL/glu.h HAVE_GL_GLU_H)
Packit Service 2594b8
check_include_file(GL/glut.h HAVE_GL_GLUT_H)
Packit Service 2594b8
check_include_file(GLUT/glut.h HAVE_GLUT_GLUT_H)
Packit Service 2594b8
check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
Packit Service 2594b8
check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
Packit Service 2594b8
Packit Service 2594b8
# Win32 IO
Packit Service 2594b8
set(win32_io FALSE)
Packit Service 2594b8
if(WIN32)
Packit Service 2594b8
  set(win32_io TRUE)
Packit Service 2594b8
endif()
Packit Service 2594b8
set(USE_WIN32_FILEIO ${win32_io} CACHE BOOL "Use win32 IO system (Microsoft Windows only)")
Packit Service 2594b8
if (USE_WIN32_FILEIO)
Packit Service 2594b8
  set(USE_WIN32_FILEIO TRUE)
Packit Service 2594b8
else()
Packit Service 2594b8
  set(USE_WIN32_FILEIO FALSE)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Orthogonal features
Packit Service 2594b8
Packit Service 2594b8
# Strip chopping
Packit Service 2594b8
option(strip-chopping "strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)" ON)
Packit Service 2594b8
set(TIFF_DEFAULT_STRIP_SIZE 8192 CACHE STRING "default size of the strip in bytes (when strip chopping is enabled)")
Packit Service 2594b8
Packit Service 2594b8
set(STRIPCHOP_DEFAULT)
Packit Service 2594b8
if(strip-chopping)
Packit Service 2594b8
  set(STRIPCHOP_DEFAULT TRUE)
Packit Service 2594b8
  if(TIFF_DEFAULT_STRIP_SIZE)
Packit Service 2594b8
    set(STRIP_SIZE_DEFAULT "${TIFF_DEFAULT_STRIP_SIZE}")
Packit Service 2594b8
  endif()
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Defer loading of strip/tile offsets
Packit Service 2594b8
option(defer-strile-load "enable deferred strip/tile offset/size loading (experimental)" OFF)
Packit Service 2594b8
set(DEFER_STRILE_LOAD ${defer-strile-load})
Packit Service 2594b8
Packit Service 2594b8
# CHUNKY_STRIP_READ_SUPPORT
Packit Service 2594b8
option(chunky-strip-read "enable reading large strips in chunks for TIFFReadScanline() (experimental)" OFF)
Packit Service 2594b8
set(CHUNKY_STRIP_READ_SUPPORT ${chunky-strip-read})
Packit Service 2594b8
Packit Service 2594b8
# SUBIFD support
Packit Service 2594b8
set(SUBIFD_SUPPORT 1)
Packit Service 2594b8
Packit Service 2594b8
# Default handling of ASSOCALPHA support.
Packit Service 2594b8
option(extrasample-as-alpha "the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly" ON)
Packit Service 2594b8
if(extrasample-as-alpha)
Packit Service 2594b8
  set(DEFAULT_EXTRASAMPLE_AS_ALPHA 1)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Default handling of YCbCr subsampling support.
Packit Service 2594b8
# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
Packit Service 2594b8
option(check-ycbcr-subsampling "enable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag" ON)
Packit Service 2594b8
if (check-ycbcr-subsampling)
Packit Service 2594b8
  set(CHECK_JPEG_YCBCR_SUBSAMPLING 1)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Generate pkg-config file
Packit Service 2594b8
set(prefix "${CMAKE_INSTALL_PREFIX}")
Packit Service 2594b8
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
Packit Service 2594b8
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
Packit Service 2594b8
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
Packit Service 2594b8
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libtiff-4.pc.in
Packit Service 2594b8
               ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc)
Packit Service 2594b8
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc
Packit Service 2594b8
        DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
Packit Service 2594b8
Packit Service 2594b8
# Includes used by libtiff (and tests)
Packit Service 2594b8
if(ZLIB_INCLUDE_DIRS)
Packit Service 2594b8
  list(APPEND TIFF_INCLUDES ${ZLIB_INCLUDE_DIRS})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JPEG_INCLUDE_DIR)
Packit Service 2594b8
  list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JPEG12_INCLUDE_DIR)
Packit Service 2594b8
  list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JBIG_INCLUDE_DIR)
Packit Service 2594b8
  list(APPEND TIFF_INCLUDES ${JBIG_INCLUDE_DIR})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(LIBLZMA_INCLUDE_DIRS)
Packit Service 2594b8
  list(APPEND TIFF_INCLUDES ${LIBLZMA_INCLUDE_DIRS})
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
# Libraries required by libtiff
Packit Service 2594b8
set(TIFF_LIBRARY_DEPS)
Packit Service 2594b8
if(M_LIBRARY)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${M_LIBRARY})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(ZLIB_LIBRARIES)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JPEG_LIBRARIES)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JPEG12_LIBRARIES)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(JBIG_LIBRARIES)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${JBIG_LIBRARIES})
Packit Service 2594b8
endif()
Packit Service 2594b8
if(LIBLZMA_LIBRARIES)
Packit Service 2594b8
  list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES})
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
#report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
Packit Service 2594b8
Packit Service 2594b8
# Process subdirectories
Packit Service 2594b8
add_subdirectory(port)
Packit Service 2594b8
add_subdirectory(libtiff)
Packit Service 2594b8
add_subdirectory(tools)
Packit Service 2594b8
add_subdirectory(test)
Packit Service 2594b8
add_subdirectory(contrib)
Packit Service 2594b8
add_subdirectory(build)
Packit Service 2594b8
add_subdirectory(man)
Packit Service 2594b8
add_subdirectory(html)
Packit Service 2594b8
Packit Service 2594b8
#message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")
Packit Service 2594b8
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
message(STATUS "Libtiff is now configured for ${host}")
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
message(STATUS "  Installation directory:             ${prefix}")
Packit Service 2594b8
message(STATUS "  Documentation directory:            ${LIBTIFF_DOCDIR}")
Packit Service 2594b8
message(STATUS "  C compiler:                         ${CMAKE_C_COMPILER}")
Packit Service 2594b8
message(STATUS "  C++ compiler:                       ${CMAKE_CXX_COMPILER}")
Packit Service 2594b8
message(STATUS "  Build shared libraries:             ${BUILD_SHARED_LIBS}")
Packit Service 2594b8
message(STATUS "  Enable linker symbol versioning:    ${HAVE_LD_VERSION_SCRIPT}")
Packit Service 2594b8
message(STATUS "  Support Microsoft Document Imaging: ${mdi}")
Packit Service 2594b8
message(STATUS "  Use win32 IO:                       ${USE_WIN32_FILEIO}")
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
message(STATUS " Support for internal codecs:")
Packit Service 2594b8
message(STATUS "  CCITT Group 3 & 4 algorithms:       ${ccitt}")
Packit Service 2594b8
message(STATUS "  Macintosh PackBits algorithm:       ${packbits}")
Packit Service 2594b8
message(STATUS "  LZW algorithm:                      ${lzw}")
Packit Service 2594b8
message(STATUS "  ThunderScan 4-bit RLE algorithm:    ${thunder}")
Packit Service 2594b8
message(STATUS "  NeXT 2-bit RLE algorithm:           ${next}")
Packit Service 2594b8
message(STATUS "  LogLuv high dynamic range encoding: ${logluv}")
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
message(STATUS " Support for external codecs:")
Packit Service 2594b8
message(STATUS "  ZLIB support:                       ${zlib} (requested) ${ZLIB_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "  Pixar log-format algorithm:         ${pixarlog} (requested) ${PIXARLOG_SUPPORT} (availability)")
Packit Service 2594b8
message(STATUS "  JPEG support:                       ${jpeg} (requested) ${JPEG_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "  Old JPEG support:                   ${old-jpeg} (requested) ${JPEG_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "  JPEG 8/12 bit dual mode:            ${jpeg12} (requested) ${JPEG12_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "  ISO JBIG support:                   ${jbig} (requested) ${JBIG_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "  LZMA2 support:                      ${lzma} (requested) ${LIBLZMA_FOUND} (availability)")
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
message(STATUS "  C++ support:                        ${cxx} (requested) ${CXX_SUPPORT} (availability)")
Packit Service 2594b8
message(STATUS "")
Packit Service 2594b8
# message(STATUS "  X Athena Widgets support:           ${HAVE_XAW}")
Packit Service 2594b8
message(STATUS "  OpenGL support:                     ${HAVE_OPENGL}")
Packit Service 2594b8
message(STATUS "")