Skip to content

Commit a965412

Browse files
author
jef
committed
optionally use external qwtpolar library
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15128 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9ddeee3 commit a965412

File tree

3 files changed

+83
-19
lines changed

3 files changed

+83
-19
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ IF (WITH_POSTGRESQL)
6363
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
6464
ENDIF (WITH_POSTGRESQL)
6565

66+
SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal built of QWTPolar")
67+
6668
SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")
6769

6870
IF (WITH_SPATIALITE)
@@ -141,6 +143,9 @@ FIND_PACKAGE(GSL) # Georeferencer
141143
FIND_PACKAGE(GEOS)
142144
FIND_PACKAGE(GDAL)
143145
FIND_PACKAGE(QWT REQUIRED)
146+
IF (NOT WITH_INTERNAL_QWTPOLAR)
147+
FIND_PACKAGE(QWTPOLAR REQUIRED)
148+
ENDIF(NOT WITH_INTERNAL_QWTPOLAR)
144149

145150
IF (NOT WITH_INTERNAL_SPATIALITE)
146151
FIND_PACKAGE(Sqlite3)

cmake/FindQwtPolar.cmake

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Find QwtPolar
2+
# ~~~~~~~~
3+
# Copyright (c) 2011, Jürgen E. Fischer <jef at norbit.de>
4+
#
5+
# Redistribution and use is allowed according to the terms of the BSD license.
6+
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
7+
#
8+
# Once run this will define:
9+
#
10+
# QWTPOLAR_FOUND = system has QWTPolar lib
11+
# QWTPOLAR_LIBRARY = full path to the QWTPolar library
12+
# QWTPOLAR_INCLUDE_DIR = where to find headers
13+
#
14+
15+
16+
#MESSAGE("Searching for QWTPolar")
17+
FIND_PATH(QWTPOLAR_INCLUDE_DIR NAMES qwt_polar.h PATHS
18+
/usr/include
19+
/usr/local/include
20+
"$ENV{LIB_DIR}/include"
21+
"$ENV{INCLUDE}"
22+
PATH_SUFFIXES qwt-qt4 qwt qwt5
23+
)
24+
25+
FIND_LIBRARY(QWTPOLAR_LIBRARY NAMES qwtpolar PATHS
26+
/usr/lib
27+
/usr/local/lib
28+
"$ENV{LIB_DIR}/lib"
29+
"$ENV{LIB}/lib"
30+
)
31+
32+
IF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)
33+
SET(QWTPOLAR_FOUND TRUE)
34+
ENDIF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)
35+
36+
IF (QWTPOLAR_FOUND)
37+
IF (NOT QWTPOLAR_FIND_QUIETLY)
38+
MESSAGE(STATUS "Found QWTPolar: ${QWTPOLAR_LIBRARY}")
39+
ENDIF (NOT QWTPOLAR_FIND_QUIETLY)
40+
ELSE (QWTPOLAR_FOUND)
41+
IF (QWTPOLAR_FIND_REQUIRED)
42+
MESSAGE(FATAL_ERROR "Could not find QWTPolar")
43+
ENDIF (QWTPOLAR_FIND_REQUIRED)
44+
ENDIF (QWTPOLAR_FOUND)

src/app/CMakeLists.txt

+34-19
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,7 @@ SET(QGIS_APP_SRCS
135135

136136
gps/qgsgpsinformationwidget.cpp
137137
gps/qgsgpsmarker.cpp
138-
gps/qwtpolar/qwt_polar_canvas.cpp
139-
gps/qwtpolar/qwt_polar_curve.cpp
140-
gps/qwtpolar/qwt_polar_fitter.cpp
141-
gps/qwtpolar/qwt_polar_grid.cpp
142-
gps/qwtpolar/qwt_polar_itemdict.cpp
143-
gps/qwtpolar/qwt_polar_item.cpp
144-
gps/qwtpolar/qwt_polar_layout.cpp
145-
gps/qwtpolar/qwt_polar_magnifier.cpp
146-
gps/qwtpolar/qwt_polar_marker.cpp
147-
gps/qwtpolar/qwt_polar_panner.cpp
148-
gps/qwtpolar/qwt_polar_plot.cpp
149-
gps/qwtpolar/qwt_polar_point.cpp
150-
gps/qwtpolar/qwt_polar_spectrogram.cpp
151-
)
138+
)
152139

153140

154141
SET (QGIS_APP_MOC_HDRS
@@ -256,12 +243,39 @@ SET (QGIS_APP_MOC_HDRS
256243
attributetable/qgsattributetabledelegate.h
257244

258245
gps/qgsgpsinformationwidget.h
259-
gps/qwtpolar/qwt_polar_canvas.h
260-
gps/qwtpolar/qwt_polar_magnifier.h
261-
gps/qwtpolar/qwt_polar_panner.h
262-
gps/qwtpolar/qwt_polar_plot.h
263246
)
264247

248+
IF(WITH_INTERNAL_QWTPOLAR)
249+
SET(QGIS_APP_SRCS
250+
${QGIS_APP_SRCS}
251+
gps/qwtpolar/qwt_polar_canvas.cpp
252+
gps/qwtpolar/qwt_polar_curve.cpp
253+
gps/qwtpolar/qwt_polar_fitter.cpp
254+
gps/qwtpolar/qwt_polar_grid.cpp
255+
gps/qwtpolar/qwt_polar_itemdict.cpp
256+
gps/qwtpolar/qwt_polar_item.cpp
257+
gps/qwtpolar/qwt_polar_layout.cpp
258+
gps/qwtpolar/qwt_polar_magnifier.cpp
259+
gps/qwtpolar/qwt_polar_marker.cpp
260+
gps/qwtpolar/qwt_polar_panner.cpp
261+
gps/qwtpolar/qwt_polar_plot.cpp
262+
gps/qwtpolar/qwt_polar_point.cpp
263+
gps/qwtpolar/qwt_polar_spectrogram.cpp
264+
)
265+
266+
SET (QGIS_APP_MOC_HDRS
267+
${QGIS_APP_MOC_HDRS}
268+
gps/qwtpolar/qwt_polar_canvas.h
269+
gps/qwtpolar/qwt_polar_magnifier.h
270+
gps/qwtpolar/qwt_polar_panner.h
271+
gps/qwtpolar/qwt_polar_plot.h
272+
)
273+
274+
SET(QWTPOLAR_INCLUDE_DIR gps/qwtpolar)
275+
SET(QWTPOLAR_LIBRARY "")
276+
ENDIF(WITH_INTERNAL_QWTPOLAR)
277+
278+
265279
IF (POSTGRES_FOUND)
266280
IF(HAVE_PGCONFIG)
267281
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
@@ -339,7 +353,6 @@ INCLUDE_DIRECTORIES(
339353
../plugins
340354
../python
341355
gps
342-
gps/qwtpolar
343356
)
344357

345358
IF (HAVE_SPATIALITE)
@@ -357,6 +370,7 @@ INCLUDE_DIRECTORIES(
357370
${PROJ_INCLUDE_DIR}
358371
${GEOS_INCLUDE_DIR}
359372
${GDAL_INCLUDE_DIR}
373+
${QWTPOLAR_INCLUDE_DIR}
360374
)
361375

362376
IF (POSTGRES_FOUND)
@@ -382,6 +396,7 @@ TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
382396
${QT_QTUITOOLS_LIBRARY}
383397
#should only be needed for win
384398
${QT_QTMAIN_LIBRARY}
399+
${QWTPOLAR_LIBRARY}
385400
qgis_core
386401
qgis_gui
387402
qgis_analysis

0 commit comments

Comments
 (0)