[Liblas-commits] hg: [cmake] Added check for required new API in GDAL - OSRSetEqu...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Oct 19 18:26:13 EDT 2009


changeset c321708ea2e5 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=c321708ea2e5
summary: [cmake] Added check for required new API in GDAL - OSRSetEquirectangular2 function.

diffstat:

 CMakeLists.txt |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 219d4c382d12 -r c321708ea2e5 CMakeLists.txt
--- a/CMakeLists.txt	Mon Oct 19 22:37:15 2009 +0100
+++ b/CMakeLists.txt	Mon Oct 19 23:25:56 2009 +0100
@@ -158,8 +158,18 @@
     FIND_PACKAGE(GDAL 1.6.0)
 
     IF(GDAL_FOUND)
-        INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIR})
-	    ADD_DEFINITIONS(-DHAVE_GDAL=1)
+        # Confirm required API is available
+        INCLUDE(CheckFunctionExists) 
+        SET(CMAKE_REQUIRED_LIBRARIES ${GDAL_LIBRARY})
+        CHECK_FUNCTION_EXISTS(OSRSetEquirectangular2 HAVE_OSRSETEQUIRECTANGULAR2)
+    
+        IF(NOT HAVE_OSRSETEQUIRECTANGULAR2)
+            GDALSET(_FOUND) # Reset to NOT found for GDAL/OGR
+            MESSAGE(FATAL_ERROR "GDAL support requires GDAL 1.6.0 or newer.")
+        ELSE()
+            INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIR})
+            ADD_DEFINITIONS(-DHAVE_GDAL=1)
+        ENDIF()
     ENDIF()
 ENDIF()
 


More information about the Liblas-commits mailing list