ENH: fix advanced bug
[cmake.git] / Modules / FindGDAL.cmake
bloba92b04c63b72bf0f6acb5af1ebce3c1f081f5165
1 # Locate gdal
2 # This module defines
3 # GDAL_LIBRARY
4 # GDAL_FOUND, if false, do not try to link to gdal 
5 # GDAL_INCLUDE_DIR, where to find the headers
7 # $GDALDIR is an environment variable that would
8 # correspond to the ./configure --prefix=$GDAL_DIR
9 # used in building gdal.
11 # Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it 
12 # for osgTerrain so I whipped this module together for completeness.
13 # I actually don't know the conventions or where files are typically
14 # placed in distros.
15 # Any real gdal users are encouraged to correct this (but please don't
16 # break the OS X framework stuff when doing so which is what usually seems 
17 # to happen).
19 # This makes the presumption that you are include gdal.h like
20 # #include "gdal.h"
22 FIND_PATH(GDAL_INCLUDE_DIR gdal.h
23   $ENV{GDAL_DIR}
24   NO_DEFAULT_PATH
25     PATH_SUFFIXES include
30 FIND_PATH(GDAL_INCLUDE_DIR gdal.h
31   PATHS
32   ~/Library/Frameworks/gdal.framework/Headers
33   /Library/Frameworks/gdal.framework/Headers
34   /usr/local/include/gdal
35   /usr/local/include/GDAL
36   /usr/local/include
37   /usr/include/gdal
38   /usr/include/GDAL
39   /usr/include
40   /sw/include/gdal 
41   /sw/include/GDAL 
42   /sw/include # Fink
43   /opt/local/include/gdal
44   /opt/local/include/GDAL
45   /opt/local/include # DarwinPorts
46   /opt/csw/include/gdal
47   /opt/csw/include/GDAL
48   /opt/csw/include # Blastwave
49   /opt/include/gdal
50   /opt/include/GDAL
51   /opt/include
54 FIND_LIBRARY(GDAL_LIBRARY 
55   NAMES gdal GDAL
56   PATHS
57   $ENV{GDAL_DIR}
58   NO_DEFAULT_PATH
59   PATH_SUFFIXES lib64 lib
62 FIND_LIBRARY(GDAL_LIBRARY 
63   NAMES gdal GDAL
64   PATHS
65     ~/Library/Frameworks
66     /Library/Frameworks
67     /usr/local
68     /usr
69     /sw
70     /opt/local
71     /opt/csw
72     /opt
73     /usr/freeware
74     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;GDAL_ROOT]/lib
75   PATH_SUFFIXES lib64 lib
78 SET(GDAL_FOUND "NO")
79 IF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)
80   SET(GDAL_FOUND "YES")
81 ENDIF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)