Skip to content

Commit 114ff9f

Browse files
committedJul 5, 2011
CMake for globe
1 parent dbc973c commit 114ff9f

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed
 

‎CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ IF (WITH_BINDINGS)
7676
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
7777
ENDIF (WITH_BINDINGS)
7878

79+
SET (WITH_GLOBE TRUE CACHE BOOL "Determines whether Globe plugin should be built")
80+
IF (WITH_GLOBE)
81+
FIND_PACKAGE(OSGEARTH)
82+
ENDIF (WITH_GLOBE)
83+
7984
# Compile flag. Make it possible to turn it off.
8085
SET (PEDANTIC TRUE CACHE BOOL "Determines if we should compile in pedantic mode.")
8186

‎cmake/FindOSGEARTH.cmake

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+

‎src/plugins/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ IF (GRASS_FOUND)
3636
ADD_SUBDIRECTORY(grass)
3737
ENDIF (GRASS_FOUND)
3838

39+
IF (OSGEARTH_FOUND)
40+
SUBDIRS (globe)
41+
ENDIF (OSGEARTH_FOUND)
42+
3943
# headers installed in qgis_core target

0 commit comments

Comments
 (0)
Please sign in to comment.