root/OpenSceneGraph/trunk/CMakeModules/FindGDAL.cmake @ 9952

Revision 9260, 2.3 kB (checked in by robert, 9 years ago)

From Gino van den Bergen, "The FindGDAL.cmake seems to be broken in OSG 2.6.1 for locating gdal.h through enviroment variable GDAL_DIR.


Also, I've modified the FindCOLLADA.cmake to locate the current 2.1 versions of the COLLADA DOM in the build directories under VC8. I've also added a COLLADA_LIBRARY_DEBUG spec. Other flavors may be added depending on compiler version and DOM version."

Line 
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
6#
7# $GDALDIR is an environment variable that would
8# correspond to the ./configure --prefix=$GDAL_DIR
9# used in building gdal.
10#
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).
18
19# This makes the presumption that you are include gdal.h like
20# #include "gdal.h"
21
22FIND_PATH(GDAL_INCLUDE_DIR gdal.h
23  PATHS
24  $ENV{GDAL_DIR}
25  NO_DEFAULT_PATH
26    PATH_SUFFIXES include
27)
28
29FIND_PATH(GDAL_INCLUDE_DIR gdal.h
30    PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
31    NO_DEFAULT_PATH
32    PATH_SUFFIXES include
33)
34
35FIND_PATH(GDAL_INCLUDE_DIR gdal.h
36  PATHS
37  ~/Library/Frameworks/gdal.framework/Headers
38  /Library/Frameworks/gdal.framework/Headers
39  /usr/local/include/gdal
40  /usr/local/include/GDAL
41  /usr/local/include
42  /usr/include/gdal
43  /usr/include/GDAL
44  /usr/include
45  /sw/include/gdal
46  /sw/include/GDAL
47  /sw/include # Fink
48  /opt/local/include/gdal
49  /opt/local/include/GDAL
50  /opt/local/include # DarwinPorts
51  /opt/csw/include/gdal
52  /opt/csw/include/GDAL
53  /opt/csw/include # Blastwave
54  /opt/include/gdal
55  /opt/include/GDAL
56  /opt/include
57)
58
59FIND_LIBRARY(GDAL_LIBRARY
60  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
61  PATHS
62  $ENV{GDAL_DIR}
63  NO_DEFAULT_PATH
64  PATH_SUFFIXES lib64 lib
65)
66FIND_LIBRARY(GDAL_LIBRARY
67  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
68  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
69    NO_DEFAULT_PATH
70    PATH_SUFFIXES lib64 lib
71)
72FIND_LIBRARY(GDAL_LIBRARY
73  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
74  PATHS
75    ~/Library/Frameworks
76    /Library/Frameworks
77    /usr/local
78    /usr
79    /sw
80    /opt/local
81    /opt/csw
82    /opt
83    /usr/freeware
84    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;GDAL_ROOT]/lib
85  PATH_SUFFIXES lib64 lib
86)
87
88SET(GDAL_FOUND "NO")
89IF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)
90  SET(GDAL_FOUND "YES")
91ENDIF(GDAL_LIBRARY AND GDAL_INCLUDE_DIR)
92
93
94
Note: See TracBrowser for help on using the browser.