Skip to content

Commit

Permalink
optionally use external qwtpolar library
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15128 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 4, 2011
1 parent 9ddeee3 commit a965412
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ IF (WITH_POSTGRESQL)
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
ENDIF (WITH_POSTGRESQL)

SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal built of QWTPolar")

SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")

IF (WITH_SPATIALITE)
Expand Down Expand Up @@ -141,6 +143,9 @@ FIND_PACKAGE(GSL) # Georeferencer
FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)
FIND_PACKAGE(QWT REQUIRED)
IF (NOT WITH_INTERNAL_QWTPOLAR)
FIND_PACKAGE(QWTPOLAR REQUIRED)
ENDIF(NOT WITH_INTERNAL_QWTPOLAR)

IF (NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(Sqlite3)
Expand Down
44 changes: 44 additions & 0 deletions cmake/FindQwtPolar.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Find QwtPolar
# ~~~~~~~~
# Copyright (c) 2011, Jürgen E. Fischer <jef at norbit.de>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Once run this will define:
#
# QWTPOLAR_FOUND = system has QWTPolar lib
# QWTPOLAR_LIBRARY = full path to the QWTPolar library
# QWTPOLAR_INCLUDE_DIR = where to find headers
#


#MESSAGE("Searching for QWTPolar")
FIND_PATH(QWTPOLAR_INCLUDE_DIR NAMES qwt_polar.h PATHS
/usr/include
/usr/local/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
PATH_SUFFIXES qwt-qt4 qwt qwt5
)

FIND_LIBRARY(QWTPOLAR_LIBRARY NAMES qwtpolar PATHS
/usr/lib
/usr/local/lib
"$ENV{LIB_DIR}/lib"
"$ENV{LIB}/lib"
)

IF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)
SET(QWTPOLAR_FOUND TRUE)
ENDIF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)

IF (QWTPOLAR_FOUND)
IF (NOT QWTPOLAR_FIND_QUIETLY)
MESSAGE(STATUS "Found QWTPolar: ${QWTPOLAR_LIBRARY}")
ENDIF (NOT QWTPOLAR_FIND_QUIETLY)
ELSE (QWTPOLAR_FOUND)
IF (QWTPOLAR_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find QWTPolar")
ENDIF (QWTPOLAR_FIND_REQUIRED)
ENDIF (QWTPOLAR_FOUND)
53 changes: 34 additions & 19 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,7 @@ SET(QGIS_APP_SRCS

gps/qgsgpsinformationwidget.cpp
gps/qgsgpsmarker.cpp
gps/qwtpolar/qwt_polar_canvas.cpp
gps/qwtpolar/qwt_polar_curve.cpp
gps/qwtpolar/qwt_polar_fitter.cpp
gps/qwtpolar/qwt_polar_grid.cpp
gps/qwtpolar/qwt_polar_itemdict.cpp
gps/qwtpolar/qwt_polar_item.cpp
gps/qwtpolar/qwt_polar_layout.cpp
gps/qwtpolar/qwt_polar_magnifier.cpp
gps/qwtpolar/qwt_polar_marker.cpp
gps/qwtpolar/qwt_polar_panner.cpp
gps/qwtpolar/qwt_polar_plot.cpp
gps/qwtpolar/qwt_polar_point.cpp
gps/qwtpolar/qwt_polar_spectrogram.cpp
)
)


SET (QGIS_APP_MOC_HDRS
Expand Down Expand Up @@ -256,12 +243,39 @@ SET (QGIS_APP_MOC_HDRS
attributetable/qgsattributetabledelegate.h

gps/qgsgpsinformationwidget.h
gps/qwtpolar/qwt_polar_canvas.h
gps/qwtpolar/qwt_polar_magnifier.h
gps/qwtpolar/qwt_polar_panner.h
gps/qwtpolar/qwt_polar_plot.h
)

IF(WITH_INTERNAL_QWTPOLAR)
SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
gps/qwtpolar/qwt_polar_canvas.cpp
gps/qwtpolar/qwt_polar_curve.cpp
gps/qwtpolar/qwt_polar_fitter.cpp
gps/qwtpolar/qwt_polar_grid.cpp
gps/qwtpolar/qwt_polar_itemdict.cpp
gps/qwtpolar/qwt_polar_item.cpp
gps/qwtpolar/qwt_polar_layout.cpp
gps/qwtpolar/qwt_polar_magnifier.cpp
gps/qwtpolar/qwt_polar_marker.cpp
gps/qwtpolar/qwt_polar_panner.cpp
gps/qwtpolar/qwt_polar_plot.cpp
gps/qwtpolar/qwt_polar_point.cpp
gps/qwtpolar/qwt_polar_spectrogram.cpp
)

SET (QGIS_APP_MOC_HDRS
${QGIS_APP_MOC_HDRS}
gps/qwtpolar/qwt_polar_canvas.h
gps/qwtpolar/qwt_polar_magnifier.h
gps/qwtpolar/qwt_polar_panner.h
gps/qwtpolar/qwt_polar_plot.h
)

SET(QWTPOLAR_INCLUDE_DIR gps/qwtpolar)
SET(QWTPOLAR_LIBRARY "")
ENDIF(WITH_INTERNAL_QWTPOLAR)


IF (POSTGRES_FOUND)
IF(HAVE_PGCONFIG)
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
Expand Down Expand Up @@ -339,7 +353,6 @@ INCLUDE_DIRECTORIES(
../plugins
../python
gps
gps/qwtpolar
)

IF (HAVE_SPATIALITE)
Expand All @@ -357,6 +370,7 @@ INCLUDE_DIRECTORIES(
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${QWTPOLAR_INCLUDE_DIR}
)

IF (POSTGRES_FOUND)
Expand All @@ -382,6 +396,7 @@ TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QT_QTUITOOLS_LIBRARY}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
${QWTPOLAR_LIBRARY}
qgis_core
qgis_gui
qgis_analysis
Expand Down

0 comments on commit a965412

Please sign in to comment.