[Liblas-commits] hg: [cmake] Added check for ST_Create function in GeoTIFF librar...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Sep 28 19:00:15 EDT 2009


changeset 246d96e3395a in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=246d96e3395a
summary: [cmake] Added check for ST_Create function in GeoTIFF library (Ticket #52)

diffstat:

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

diffs (24 lines):

diff -r 00a83380e688 -r 246d96e3395a CMakeLists.txt
--- a/CMakeLists.txt	Mon Sep 28 18:08:49 2009 +0100
+++ b/CMakeLists.txt	Tue Sep 29 00:00:06 2009 +0100
@@ -99,8 +99,18 @@
     FIND_PACKAGE(GeoTIFF 1.2.5)
 
     IF(GEOTIFF_FOUND)
-        INCLUDE_DIRECTORIES(${GEOTIFF_INCLUDE_DIR})
-        ADD_DEFINITIONS(-DHAVE_LIBGEOTIFF=1)
+    
+        INCLUDE(CheckFunctionExists) 
+        SET(CMAKE_REQUIRED_LIBRARIES ${GEOTIFF_LIBRARY})
+        CHECK_FUNCTION_EXISTS(ST_Create HAVE_ST_CREATE)
+    
+        IF(NOT HAVE_ST_CREATE)
+            SET(GEOTIFF_FOUND) # Reset to NOT found for GeoTIFF
+            MESSAGE(FATAL_ERROR "GeoTIFF support requires libgeotiff 1.2.5 or newer.")
+        ELSE()
+            INCLUDE_DIRECTORIES(${GEOTIFF_INCLUDE_DIR})
+            ADD_DEFINITIONS(-DHAVE_LIBGEOTIFF=1)
+        ENDIF()
     ENDIF()
 ENDIF()
 


More information about the Liblas-commits mailing list