File: FindTIFF.cmake

package info (click to toggle)
hugin 2016.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,072 kB
  • ctags: 11,979
  • sloc: cpp: 116,753; ansic: 6,335; python: 1,517; perl: 577; sh: 168; xml: 102; makefile: 64
file content (68 lines) | stat: -rwxr-xr-x 2,389 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# - Find TIFF for Hugin 0.7 01Nov2007 TKSharpless
# Added to support Windows build but should work anywhere.
# After looking in UNIX standard places, tries wxWidgets build 
# tree, which should have this package.
#
# Call FIND_PACKAGE(wxWidgets REQUIRED) before calling this!
# 
# reads cache variables
#  wxWidgets_ROOT_DIR
#  wxWidgets_LIB_DIR
# defines cache variables
#  TIFF_INCLUDE_DIR, where to find headers
#  TIFF_LIBRARIES, list of link libraries for release
#  TIFF_DEBUG_LIBRARIES ditto for debug
#  TIFF_FOUND, If != "YES", do not try to use TIFF.

FIND_PATH(TIFF_INCLUDE_DIR tiff.h
  /usr/local/include
  /usr/include
  ${SOURCE_BASE_DIR}/libtiff/include
  ${SOURCE_BASE_DIR}/tiff-4.0.6/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.5/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.4/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.3/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.1/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.0beta7/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.0beta6/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.0beta5/libtiff
  ${SOURCE_BASE_DIR}/tiff-3.8.2/libtiff
  ${SOURCE_BASE_DIR}/tiff-4.0.0alpha/libtiff
  ${wxWidgets_ROOT_DIR}/src/tiff
  ${wxWidgets_ROOT_DIR}/src/tiff/libtiff
)

include(FindLibraryWithDebug)

IF(WIN32 AND ("${HUGIN_SHARED}" OR "${BUILD_DLL}") AND MSVC)
  # on windows the libtiff library contains a static lib libtiff
  # and the import library libtiff_i for dynamic build
  set(_LIBTIFF_LIB_NAME libtiff_i tiff)
ELSE()
  set(_LIBTIFF_LIB_NAME tiff libtiff wxtiff)
ENDIF()

find_library_with_debug(TIFF_LIBRARIES
    WIN32_DEBUG_POSTFIX d
    NAMES ${_LIBTIFF_LIB_NAME}
    PATHS ${SYSTEM_LIB_DIRS}
          ${SOURCE_BASE_DIR}/libtiff/lib
          ${SOURCE_BASE_DIR}/tiff-4.0.6/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.5/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.4/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.3/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.1/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.0beta7/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.0beta6/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.0beta5/libtiff
          ${SOURCE_BASE_DIR}/tiff-3.8.2/libtiff
          ${SOURCE_BASE_DIR}/tiff-4.0.0alpha/libtiff
          ${wxWidgets_LIB_DIR}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TIFF DEFAULT_MSG 
                                  TIFF_INCLUDE_DIR TIFF_LIBRARIES)

MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARIES)