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 69 70 71 72 73 74 75 76 77 78 79 80 81
|
# - Try to find GDAL
# Once done this will define
#
# GDAL_FOUND - system has GDAL
# GDAL_INCLUDE_DIRS - the GDAL include directory
# GDAL_LIBRARIES - Link these to use GDAL
# GDAL_DEFINITIONS - Compiler switches required for using GDAL
#
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (GDAL_LIBRARIES AND GDAL_INCLUDE_DIRS)
# in cache already
set(GDAL_FOUND TRUE)
else (GDAL_LIBRARIES AND GDAL_INCLUDE_DIRS)
find_path(GDAL_INCLUDE_DIR
NAMES
gdal.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
/usr/include/gdal
/usr/local/include/gdal
/opt/local/include/gdal
/sw/include/gdal
C:/Progra~1/FWTools2.2.8/include
C:/Progra~1/FWTools2.1.0/include
)
# debian uses version suffixes
# add suffix evey new release
find_library(GDAL_LIBRARY
NAMES
gdal
gdal1.3.2
gdal1.4.0
gdal1.5.0
gdal
gdal_i
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
C:/Progra~1/FWTools2.2.8/lib
C:/Progra~1/FWTools2.1.0/lib
)
set(GDAL_INCLUDE_DIRS
${GDAL_INCLUDE_DIR}
)
set(GDAL_LIBRARIES
${GDAL_LIBRARY}
)
if (GDAL_INCLUDE_DIRS AND GDAL_LIBRARIES)
set(GDAL_FOUND TRUE)
endif (GDAL_INCLUDE_DIRS AND GDAL_LIBRARIES)
if (GDAL_FOUND)
if (NOT GDAL_FIND_QUIETLY)
message(STATUS "Found GDAL: ${GDAL_LIBRARIES}")
endif (NOT GDAL_FIND_QUIETLY)
else (GDAL_FOUND)
if (GDAL_FIND_REQUIRED)
message(FATAL_ERROR "Could not find GDAL")
endif (GDAL_FIND_REQUIRED)
endif (GDAL_FOUND)
# show the GDAL_INCLUDE_DIRS and GDAL_LIBRARIES variables only in the advanced view
mark_as_advanced(GDAL_INCLUDE_DIRS GDAL_LIBRARIES)
endif (GDAL_LIBRARIES AND GDAL_INCLUDE_DIRS)
|