STYLE: Nightly Date Stamp
[cmake.git] / Modules / FindGDAL.cmake
blobe21fe833ef58c24c087cfb5ebf4d0411b0673e46
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   HINTS
24   $ENV{GDAL_DIR}
25   PATH_SUFFIXES include
26   PATHS
27   ~/Library/Frameworks/gdal.framework/Headers
28   /Library/Frameworks/gdal.framework/Headers
29   /usr/local/include/gdal
30   /usr/local/include/GDAL
31   /usr/local/include
32   /usr/include/gdal
33   /usr/include/GDAL
34   /usr/include
35   /sw/include/gdal 
36   /sw/include/GDAL 
37   /sw/include # Fink
38   /opt/local/include/gdal
39   /opt/local/include/GDAL
40   /opt/local/include # DarwinPorts
41   /opt/csw/include/gdal
42   /opt/csw/include/GDAL
43   /opt/csw/include # Blastwave
44   /opt/include/gdal
45   /opt/include/GDAL
46   /opt/include
49 FIND_LIBRARY(GDAL_LIBRARY 
50   NAMES gdal GDAL
51   HINTS
52   $ENV{GDAL_DIR}
53   PATH_SUFFIXES lib64 lib
54   PATHS
55     ~/Library/Frameworks
56     /Library/Frameworks
57     /usr/local
58     /usr
59     /sw
60     /opt/local
61     /opt/csw
62     /opt
63     /usr/freeware
64     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;GDAL_ROOT]/lib
67 SET(GDAL_FOUND "NO")
68 IF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)
69   SET(GDAL_FOUND "YES")
70 ENDIF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)