|
From: <and...@us...> - 2012-10-03 13:08:49
|
Revision: 12234
http://plplot.svn.sourceforge.net/plplot/?rev=12234&view=rev
Author: andrewross
Date: 2012-10-03 13:08:38 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
Add in cmake support for shapelib library to read in shapefiles.
Modified Paths:
--------------
trunk/cmake/modules/plplot.cmake
trunk/cmake/modules/summary.cmake
Added Paths:
-----------
trunk/cmake/modules/FindShapelib.cmake
trunk/cmake/modules/shapelib.cmake
Added: trunk/cmake/modules/FindShapelib.cmake
===================================================================
--- trunk/cmake/modules/FindShapelib.cmake (rev 0)
+++ trunk/cmake/modules/FindShapelib.cmake 2012-10-03 13:08:38 UTC (rev 12234)
@@ -0,0 +1,36 @@
+# Find shapelib header and library.
+#
+
+# This module defines the following uncached variables:
+# SHAPELIB_FOUND, if false, do not try to use shapelib.
+# SHAPELIB_INCLUDE_DIRS, where to find shapefil.h.
+# SHAPELIB_LIBRARIES, the libraries to link against to use shapelib
+# SHAPELIB_LIBRARY_DIRS, the directory where libshp (either shared or static)
+# is found.
+
+find_path(SHAPELIB_INCLUDE_DIR shapefil.h /usr/local/include /usr/include)
+
+if(SHAPELIB_INCLUDE_DIR)
+ find_library(SHAPELIB_LIBRARY
+ NAMES shp
+ PATHS /usr/local/lib /usr/lib
+ )
+ if(SHAPELIB_LIBRARY)
+ set(SHAPELIB_LIBRARY_DIR "")
+ get_filename_component(SHAPELIB_LIBRARY_DIRS ${SHAPELIB_LIBRARY} PATH)
+ # Set uncached variables as per standard.
+ set(SHAPELIB_FOUND ON)
+ set(SHAPELIB_INCLUDE_DIRS ${SHAPELIB_INCLUDE_DIR})
+ set(SHAPELIB_LIBRARIES ${SHAPELIB_LIBRARY})
+ endif(SHAPELIB_LIBRARY)
+endif(SHAPELIB_INCLUDE_DIR)
+
+if(SHAPELIB_FOUND)
+ if(NOT SHAPELIB_FIND_QUIETLY)
+ message(STATUS "FindShapelib: Found shapelib header directory, ${SHAPELIB_INCLUDE_DIR}, and library, ${SHAPELIB_LIBRARIES}.")
+ endif(NOT SHAPELIB_FIND_QUIETLY)
+else(SHAPELIB_FOUND)
+ if(SHAPELIB_FIND_REQUIRED)
+ message(FATAL_ERROR "FindShapelib: Could not find shapelib header and/or library.")
+ endif(SHAPELIB_FIND_REQUIRED)
+endif(SHAPELIB_FOUND)
Property changes on: trunk/cmake/modules/FindShapelib.cmake
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/cmake/modules/plplot.cmake
===================================================================
--- trunk/cmake/modules/plplot.cmake 2012-10-02 20:13:08 UTC (rev 12233)
+++ trunk/cmake/modules/plplot.cmake 2012-10-03 13:08:38 UTC (rev 12234)
@@ -441,6 +441,9 @@
message(STATUS "X11_COMPILE_FLAGS = ${X11_COMPILE_FLAGS}")
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
+# Support for shapelib library for reading shapefile map data
+include(shapelib)
+
option(DEFAULT_NO_BINDINGS
"All language bindings are disabled by default"
OFF
Added: trunk/cmake/modules/shapelib.cmake
===================================================================
--- trunk/cmake/modules/shapelib.cmake (rev 0)
+++ trunk/cmake/modules/shapelib.cmake 2012-10-03 13:08:38 UTC (rev 12234)
@@ -0,0 +1,40 @@
+# cmake/modules/shapefil.cmake
+#
+# Copyright (C) 2012 Andrew Ross
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; version 2 of the License.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with the file PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Configuration for SHAPELIB support in plplot.
+
+option(
+HAVE_SHAPELIB
+"Enable driver options for using shapelib library for reading shapefile map data"
+ON
+)
+
+# Look for shapelib libraries
+if (HAVE_SHAPELIB)
+ find_package(Shapelib)
+ if(NOT SHAPELIB_FOUND)
+ message(STATUS
+ "WARNING: SHAPELIB not found. Setting HAVE_SHAPELIB to OFF."
+ )
+ set(HAVE_SHAPELIB OFF
+ CACHE BOOL "Enable driver options for using SHAPELIB library for reading shapefile map data"
+ FORCE
+ )
+ endif(NOT SHAPELIB_FOUND)
+endif (HAVE_SHAPELIB)
Property changes on: trunk/cmake/modules/shapelib.cmake
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/cmake/modules/summary.cmake
===================================================================
--- trunk/cmake/modules/summary.cmake 2012-10-02 20:13:08 UTC (rev 12233)
+++ trunk/cmake/modules/summary.cmake 2012-10-03 13:08:38 UTC (rev 12234)
@@ -107,7 +107,7 @@
Optional libraries:
PL_HAVE_QHULL: ${PL_HAVE_QHULL} WITH_CSA: ${WITH_CSA}
HAVE_FREETYPE: ${HAVE_FREETYPE} PL_HAVE_PTHREAD: ${PL_HAVE_PTHREAD}
-HAVE_AGG: ${HAVE_AGG}
+HAVE_AGG: ${HAVE_AGG} HAVE_SHAPELIB: ${HAVE_SHAPELIB}
Language Bindings:
ENABLE_f77: ${ENABLE_f77} ENABLE_f95: ${ENABLE_f95}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|