External_tiff.cmake 2.09 KB
Newer Older
1
#
Julien Michel's avatar
Julien Michel committed
2
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

21
INCLUDE_ONCE_MACRO(TIFF)
22

23
SETUP_SUPERBUILD(TIFF)
24

25 26
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(TIFF ZLIB JPEG)
27

28
if(MSVC)
29
  set(TIFF_C_FLAGS "/D_CRT_SECURE_NO_WARNINGS /DWIN32")
30
endif()
31

32 33 34 35 36 37 38 39 40 41 42 43 44 45
ExternalProject_Add(TIFF
  PREFIX TIFF
  URL "http://download.osgeo.org/libtiff/tiff-4.0.8.tar.gz"
  URL_MD5 2a7d1c1318416ddf36d5f6fa4600069b
  SOURCE_DIR ${TIFF_SB_SRC}
  BINARY_DIR ${TIFF_SB_BUILD_DIR}
  INSTALL_DIR ${SB_INSTALL_PREFIX}
  DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
  DEPENDS ${TIFF_DEPENDENCIES}
  CMAKE_CACHE_ARGS
  ${SB_CMAKE_CACHE_ARGS}
  -DCMAKE_C_FLAGS:STRING=${TIFF_C_FLAGS}
  -DCMAKE_INSTALL_LIBDIR:PATH=lib
  -DCMAKE_INSTALL_BINDIR:PATH=bin
46 47
  -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=TRUE
  -DBUILD_TESTING:BOOL=FALSE
48 49 50 51 52 53 54 55 56 57 58 59 60 61
  -Djpeg:BOOL=TRUE
  -Dlzma:BOOL=FALSE
  -Djbig:BOOL=FALSE
  -Dzlib:BOOL=TRUE
  -DWITH_OPENGL:BOOL=FALSE
  -Dpixarlog:BOOL=TRUE
  -Dcxx:BOOL=FALSE
  -Dwith_opengl:BOOL=FALSE
  -Dwith_tools:BOOL=FALSE
  -Dwith_test:BOOL=FALSE
  -Dwith_contrib:BOOL=FALSE
  -Dwith_docs:BOOL=FALSE
  ${TIFF_SB_CONFIG}
  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
62
  LOG_DOWNLOAD 1
63 64 65 66 67
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_INSTALL 1
  )
    
68 69
SUPERBUILD_PATCH_SOURCE(TIFF)

70
#do we really need these variables? 
71 72
set(_SB_TIFF_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
73
  set(_SB_TIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/tiff.lib)
74 75
elseif(UNIX)
  set(_SB_TIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff${CMAKE_SHARED_LIBRARY_SUFFIX})
76
endif()