|
| 1 | +# This module defines |
| 2 | + |
| 3 | +# OSGEARTH_LIBRARY |
| 4 | +# OSGEARTH_FOUND, if false, do not try to link to osg |
| 5 | +# OSGEARTH_INCLUDE_DIRS, where to find the headers |
| 6 | +# OSGEARTH_INCLUDE_DIR, where to find the source headers |
| 7 | +# OSGEARTH_GEN_INCLUDE_DIR, where to find the generated headers |
| 8 | + |
| 9 | +# to use this module, set variables to point to the osg build |
| 10 | +# directory, and source directory, respectively |
| 11 | +# OSGEARTHDIR or OSGEARTH_SOURCE_DIR: osg source directory, typically OpenSceneGraph |
| 12 | +# OSGEARTH_DIR or OSGEARTH_BUILD_DIR: osg build directory, place in which you've |
| 13 | +# built osg via cmake |
| 14 | + |
| 15 | +# Header files are presumed to be included like |
| 16 | +# #include <osgEarth/Common> |
| 17 | +# #include <osgEarth/TileSource> |
| 18 | + |
| 19 | +###### headers ###### |
| 20 | + |
| 21 | +MACRO( FIND_OSGEARTH_INCLUDE THIS_OSGEARTH_INCLUDE_DIR THIS_OSGEARTH_INCLUDE_FILE ) |
| 22 | + |
| 23 | +FIND_PATH( ${THIS_OSGEARTH_INCLUDE_DIR} ${THIS_OSGEARTH_INCLUDE_FILE} |
| 24 | + PATHS |
| 25 | + ${OSGEARTH_DIR} |
| 26 | + $ENV{OSGEARTH_SOURCE_DIR} |
| 27 | + $ENV{OSGEARTHDIR} |
| 28 | + $ENV{OSGEARTH_DIR} |
| 29 | + /usr/local/ |
| 30 | + /usr/ |
| 31 | + /sw/ # Fink |
| 32 | + /opt/local/ # DarwinPorts |
| 33 | + /opt/csw/ # Blastwave |
| 34 | + /opt/ |
| 35 | + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSGEARTH_ROOT]/ |
| 36 | + ~/Library/Frameworks |
| 37 | + /Library/Frameworks |
| 38 | + PATH_SUFFIXES |
| 39 | + /include/ |
| 40 | +) |
| 41 | + |
| 42 | +ENDMACRO( FIND_OSGEARTH_INCLUDE THIS_OSGEARTH_INCLUDE_DIR THIS_OSGEARTH_INCLUDE_FILE ) |
| 43 | + |
| 44 | +FIND_OSGEARTH_INCLUDE( OSGEARTH_GEN_INCLUDE_DIR osgEarth/Common ) |
| 45 | +FIND_OSGEARTH_INCLUDE( OSGEARTH_INCLUDE_DIR osgEarth/TileSource ) |
| 46 | + |
| 47 | +###### libraries ###### |
| 48 | + |
| 49 | +MACRO( FIND_OSGEARTH_LIBRARY MYLIBRARY MYLIBRARYNAME ) |
| 50 | + |
| 51 | +FIND_LIBRARY(${MYLIBRARY} |
| 52 | + NAMES |
| 53 | + ${MYLIBRARYNAME} |
| 54 | + PATHS |
| 55 | + ${OSGEARTH_DIR} |
| 56 | + $ENV{OSGEARTH_BUILD_DIR} |
| 57 | + $ENV{OSGEARTH_DIR} |
| 58 | + $ENV{OSGEARTHDIR} |
| 59 | + $ENV{OSGEARTH_ROOT} |
| 60 | + ~/Library/Frameworks |
| 61 | + /Library/Frameworks |
| 62 | + /usr/local |
| 63 | + /usr |
| 64 | + /sw |
| 65 | + /opt/local |
| 66 | + /opt/csw |
| 67 | + /opt |
| 68 | + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSGEARTH_ROOT]/lib |
| 69 | + /usr/freeware |
| 70 | + PATH_SUFFIXES |
| 71 | + /lib/ |
| 72 | + /lib64/ |
| 73 | + /build/lib/ |
| 74 | + /build/lib64/ |
| 75 | + /Build/lib/ |
| 76 | + /Build/lib64/ |
| 77 | + ) |
| 78 | + |
| 79 | +ENDMACRO(FIND_OSGEARTH_LIBRARY LIBRARY LIBRARYNAME) |
| 80 | + |
| 81 | +FIND_OSGEARTH_LIBRARY( OSGEARTH_LIBRARY osgEarth ) |
| 82 | +FIND_OSGEARTH_LIBRARY( OSGEARTH_LIBRARY_DEBUG osgEarthd) |
| 83 | + |
| 84 | +FIND_OSGEARTH_LIBRARY( OSGEARTHUTIL_LIBRARY osgEarthUtil ) |
| 85 | +FIND_OSGEARTH_LIBRARY( OSGEARTHUTIL_LIBRARY_DEBUG osgEarthUtild) |
| 86 | + |
| 87 | +FIND_OSGEARTH_LIBRARY( OSGEARTHFEATURES_LIBRARY osgEarthFeatures ) |
| 88 | +FIND_OSGEARTH_LIBRARY( OSGEARTHFEATURES_LIBRARY_DEBUG osgEarthFeaturesd) |
| 89 | + |
| 90 | +FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY osgEarthSymbology ) |
| 91 | +FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY_DEBUG osgEarthSymbologyd ) |
| 92 | + |
| 93 | + |
| 94 | +SET( OSGEARTH_FOUND "NO" ) |
| 95 | +IF( OSGEARTH_LIBRARY AND OSGEARTH_INCLUDE_DIR ) |
| 96 | + SET( OSGEARTH_FOUND "YES" ) |
| 97 | + SET( OSGEARTH_INCLUDE_DIRS ${OSGEARTH_INCLUDE_DIR} ${OSGEARTH_GEN_INCLUDE_DIR} ) |
| 98 | + GET_FILENAME_COMPONENT( OSGEARTH_LIBRARIES_DIR ${OSGEARTH_LIBRARY} PATH ) |
| 99 | +ENDIF( OSGEARTH_LIBRARY AND OSGEARTH_INCLUDE_DIR ) |
| 100 | + |
| 101 | + |
0 commit comments