swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: 54f019ef1026f8a3ab8fafd49eeec7cfb62e5abd authored by renchao_lu on 12 March 2021, 00:26:53 UTC
[CL] rename function.
Tip revision: 54f019e
FindGEOTIFF.cmake
# - Try to find libgeotiff
#
# Once done, this will define
#
#  GEOTIFF_FOUND
#  GEOTIFF_INCLUDE_DIRS
#  GEOTIFF_LIBRARIES

###
# Dependencies
###
set(_deps_libs)
set(_deps_includes)
set(_deps_check)

find_path( libgeotiff_INCLUDE_DIR geotiff.h)
find_library(libgeotiff_LIBRARY geotiff)

find_path( xtiff_INCLUDE_DIR xtiffio.h)
if(MSVC)
    find_library(xtiff_LIBRARY xtiff)
    list(APPEND _deps_libs ${xtiff_LIBRARY})
endif()

find_package(TIFF)

list(APPEND _deps_libs ${TIFF_LIBRARIES})
list(APPEND _deps_includes ${TIFF_INCLUDE_DIRS})
list(APPEND _deps_check TIFF_FOUND)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GEOTIFF
    REQUIRED_VARS
    libgeotiff_LIBRARY
    libgeotiff_INCLUDE_DIR
    xtiff_INCLUDE_DIR
    ${_deps_check}
)

if(GEOTIFF_FOUND)
    set(GEOTIFF_INCLUDE_DIRS ${libgeotiff_INCLUDE_DIR} ${xtiff_INCLUDE_DIR} ${_deps_includes})
    set(GEOTIFF_LIBRARIES ${libgeotiff_LIBRARY} ${_deps_libs})
endif()
back to top