[QGIS Commit] r15128 - in trunk/qgis: . cmake src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Feb 4 10:35:49 EST 2011


Author: jef
Date: 2011-02-04 07:35:49 -0800 (Fri, 04 Feb 2011)
New Revision: 15128

Added:
   trunk/qgis/cmake/FindQwtPolar.cmake
Modified:
   trunk/qgis/CMakeLists.txt
   trunk/qgis/src/app/CMakeLists.txt
Log:
optionally use external qwtpolar library

Modified: trunk/qgis/CMakeLists.txt
===================================================================
--- trunk/qgis/CMakeLists.txt	2011-02-04 12:50:47 UTC (rev 15127)
+++ trunk/qgis/CMakeLists.txt	2011-02-04 15:35:49 UTC (rev 15128)
@@ -63,6 +63,8 @@
   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)
@@ -141,6 +143,9 @@
 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)

Added: trunk/qgis/cmake/FindQwtPolar.cmake
===================================================================
--- trunk/qgis/cmake/FindQwtPolar.cmake	                        (rev 0)
+++ trunk/qgis/cmake/FindQwtPolar.cmake	2011-02-04 15:35:49 UTC (rev 15128)
@@ -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)

Modified: trunk/qgis/src/app/CMakeLists.txt
===================================================================
--- trunk/qgis/src/app/CMakeLists.txt	2011-02-04 12:50:47 UTC (rev 15127)
+++ trunk/qgis/src/app/CMakeLists.txt	2011-02-04 15:35:49 UTC (rev 15128)
@@ -135,20 +135,7 @@
 
   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
@@ -256,12 +243,39 @@
   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)
@@ -339,7 +353,6 @@
   ../plugins
   ../python
   gps
-  gps/qwtpolar
   )
 
 IF (HAVE_SPATIALITE)
@@ -357,6 +370,7 @@
   ${PROJ_INCLUDE_DIR}
   ${GEOS_INCLUDE_DIR}
   ${GDAL_INCLUDE_DIR}
+  ${QWTPOLAR_INCLUDE_DIR}
 )
 
 IF (POSTGRES_FOUND)
@@ -382,6 +396,7 @@
   ${QT_QTUITOOLS_LIBRARY}
   #should only be needed for win
   ${QT_QTMAIN_LIBRARY} 
+  ${QWTPOLAR_LIBRARY}
   qgis_core
   qgis_gui
   qgis_analysis



More information about the QGIS-commit mailing list