Skip to content

Commit d56e4e9

Browse files
committedJul 6, 2011
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents dd79841 + 49e9a62 commit d56e4e9

File tree

272 files changed

+4292
-780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+4292
-780
lines changed
 

‎CMakeLists.txt

Lines changed: 21 additions & 7 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

@@ -269,16 +274,19 @@ ELSE (WIN32)
269274

270275
IF (APPLE)
271276
# for Mac OS X, everything is put inside an application bundle
277+
# save the root install prefix for the app later
278+
SET (QGIS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
272279
SET (QGIS_MACAPP_PREFIX ${CMAKE_INSTALL_PREFIX}/${QGIS_APP_NAME}.app/Contents)
280+
# common prefix for components, let cmake handle it
273281
SET (CMAKE_INSTALL_PREFIX ${QGIS_MACAPP_PREFIX}/MacOS)
274-
# path for library references
275-
SET (CMAKE_INSTALL_NAME_DIR @executable_path/lib)
276282
# 4 bundling levels, each includes previous
277283
# 0 nothing
278284
# 1 Qt frameworks
279285
# 2 non-system libraries, "standard"
280286
# 3 non-system frameworks, "standalone"
281-
SET (QGIS_MACAPP_BUNDLE 0 CACHE STRING "What to bundle into app package")
287+
SET (QGIS_MACAPP_BUNDLE 1 CACHE STRING "What to bundle into app package")
288+
SET (QGIS_MACAPP_INSTALL_DEV FALSE CACHE BOOL "Install developer frameworks")
289+
SET (QGIS_MACAPP_DEV_PREFIX "/Library/Frameworks" CACHE STRING "Path to install developer frameworks")
282290
# if we have @loader_path, >=OSX 10.5 (darwin 9+)
283291
IF (CMAKE_SYSTEM_VERSION VERSION_GREATER 9.0.0 OR CMAKE_SYSTEM_VERSION VERSION_EQUAL 9.0.0)
284292
SET (OSX_HAVE_LOADERPATH 1)
@@ -303,6 +311,8 @@ ELSE (WIN32)
303311
SET (DEFAULT_PLUGIN_SUBDIR ../PlugIns/qgis)
304312
SET (QGIS_PLUGIN_SUBDIR_REV ../../MacOS)
305313
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
314+
# path for framework references
315+
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
306316

307317
ELSE (APPLE)
308318
# UNIX
@@ -367,12 +377,12 @@ SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
367377
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})
368378

369379
# manual page - makes sense only on unix systems
370-
IF (UNIX)
380+
IF (UNIX AND NOT APPLE)
371381
SET (DEFAULT_MANUAL_SUBDIR man)
372382
SET (QGIS_MANUAL_SUBDIR ${DEFAULT_MANUAL_SUBDIR} CACHE STRING "Subdirectory where manual files will be installed")
373383
MARK_AS_ADVANCED (QGIS_MANUAL_SUBDIR)
374384
SET (QGIS_MANUAL_DIR ${CMAKE_INSTALL_PREFIX}/${QGIS_MANUAL_SUBDIR})
375-
ENDIF (UNIX)
385+
ENDIF (UNIX AND NOT APPLE)
376386

377387
#############################################################
378388
# Python bindings
@@ -402,9 +412,9 @@ ENDIF (WITH_BINDINGS)
402412

403413
#############################################################
404414
# create qgsconfig.h
415+
# installed with app target
405416

406417
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/qgsconfig.h.in ${CMAKE_BINARY_DIR}/qgsconfig.h)
407-
INSTALL(FILES ${CMAKE_BINARY_DIR}/qgsconfig.h DESTINATION ${QGIS_INCLUDE_DIR})
408418
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
409419

410420
# Added by Jef to prevent python core and gui libs linking to other qgisCore and qgisGui libs
@@ -427,18 +437,22 @@ IF (GIT_MARKER)
427437
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
428438
)
429439
ELSE(MSVC)
440+
EXECUTE_PROCESS(COMMAND ${GIT} log -n1 --pretty=%h OUTPUT_VARIABLE REVISION)
441+
STRING(STRIP "${REVISION}" REVISION)
430442
ADD_CUSTOM_COMMAND(
431443
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
432-
COMMAND echo \\\#define QGSVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
444+
COMMAND echo \\\#define QGSVERSION \\\"${REVISION}\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
433445
MAIN_DEPENDENCY ${GIT_MARKER}
434446
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
435447
)
436448
ENDIF(MSVC)
437449
ELSE(GIT)
438450
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
451+
SET(REVISION "unknown")
439452
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"")
440453
ENDIF(GIT)
441454
ELSE (GIT_MARKER)
455+
SET(REVISION "exported")
442456
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"exported\"")
443457
ENDIF (GIT_MARKER)
444458

‎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+

0 commit comments

Comments
 (0)
Please sign in to comment.