[Liblas-commits] hg: Added default OSGEO_HOME located in C:/OSGeo4W to search pat...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Oct 19 16:02:32 EDT 2009


changeset a11bf44844f7 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=a11bf44844f7
summary: Added default OSGEO_HOME located in C:/OSGeo4W to search path for GeoTIFF and SpatialIndex on Windows

diffstat:

 build/cmake/FindGeoTIFF.cmake      |  32 +++++++++++++++++++-------------
 build/cmake/FindSpatialIndex.cmake |  18 +++++++++++++++---
 2 files changed, 34 insertions(+), 16 deletions(-)

diffs (104 lines):

diff -r 2b2fa43686d7 -r a11bf44844f7 build/cmake/FindGeoTIFF.cmake
--- a/build/cmake/FindGeoTIFF.cmake	Mon Oct 19 14:42:01 2009 -0500
+++ b/build/cmake/FindGeoTIFF.cmake	Mon Oct 19 21:02:24 2009 +0100
@@ -1,22 +1,22 @@
 ###############################################################################
+#
 # CMake module to search for GeoTIFF library
 #
 # On success, the macro sets the following variables:
 # GEOTIFF_FOUND       = if the library found
-# GEOTIFF_LIBRARY     = full path to the library
+# GEOTIFF_LIBRARIES   = full path to the library
 # GEOTIFF_INCLUDE_DIR = where to find the library headers 
-#
-# On Unix, macro sets also:
-# GEOTIFF_VERSION_STRING = human-readable string containing version of the library
+# also defined, but not for general use are
+# GEOTIFF_LIBRARY, where to find the PROJ.4 library.
 #
 # Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
 #
+# Module source: http://github.com/mloskot/workshop/tree/master/cmake/
+#
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 #
 ###############################################################################
-MESSAGE(STATUS "Searching for GeoTIFF ${GeoTIFF_FIND_VERSION}+ library")
-MESSAGE(STATUS "   NOTE: Required version is not checked - to be implemented")
 
 SET(GEOTIFF_NAMES geotiff)
 
@@ -40,14 +40,20 @@
     ENDIF(MINGW)
 
     IF(MSVC)
-        SET(GEOTIFF_INCLUDE_DIR "$ENV{LIB_DIR}/include" CACHE STRING INTERNAL)
+        FIND_PATH(GEOTIFF_INCLUDE_DIR
+            geotiff.h
+            PATH_PREFIXES geotiff
+            PATHS
+            "$ENV{LIB_DIR}/include"
+            c:/OSGeo4W/include
+            c:/msys/local/include)
 
         SET(GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i)
         FIND_LIBRARY(GEOTIFF_LIBRARY NAMES 
             NAMES ${GEOTIFF_NAMES}
             PATHS
             "$ENV{LIB_DIR}/lib"
-            /usr/lib
+            c:/OSGeo4W/lib
             c:/msys/local/lib)
     ENDIF(MSVC)
   
@@ -58,14 +64,14 @@
     FIND_LIBRARY(GEOTIFF_LIBRARY NAMES ${GEOTIFF_NAMES})
 
 ELSE()
-    MESSAGE("FindGeoTIFF.cmake: unrecognized or unsupported operating system (use Unix or Windows)")
+    MESSAGE("FindGeoTIFF.cmake: unrecognized or unsupported operating system")
+ENDIF()
+
+IF(GEOTIFF_FOUND)
+  SET(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY})
 ENDIF()
 
 # Handle the QUIETLY and REQUIRED arguments and set SPATIALINDEX_FOUND to TRUE
 # if all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
-
-# TODO: Do we want to mark these as advanced? --mloskot
-# http://www.cmake.org/cmake/help/cmake2.6docs.html#command:mark_as_advanced
-#MARK_AS_ADVANCED(GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
diff -r 2b2fa43686d7 -r a11bf44844f7 build/cmake/FindSpatialIndex.cmake
--- a/build/cmake/FindSpatialIndex.cmake	Mon Oct 19 14:42:01 2009 -0500
+++ b/build/cmake/FindSpatialIndex.cmake	Mon Oct 19 21:02:24 2009 +0100
@@ -20,10 +20,22 @@
     SET(SPATIALINDEX_FIND_QUIETLY TRUE)
 ENDIF()
 
-FIND_PATH(SPATIALINDEX_INCLUDE_DIR NAMES RTree.h PATH_PREFIXES spatialindex)
+IF(MSVC)
+    SET(OSGEO4W_IMPORT_LIBRARY spatialindex_i)
+    SET(DEFAULT_OSGEO4W_HOME_DIR c:/OSGeo4W)
+ENDIF()
 
-SET(SPATIALINDEX_NAMES spatialindex)
-FIND_LIBRARY(SPATIALINDEX_LIBRARY NAMES ${SPATIALINDEX_NAMES} )
+FIND_PATH(SPATIALINDEX_INCLUDE_DIR
+    NAMES RTree.h 
+    PATH_PREFIXES spatialindex
+    PATHS
+    ${DEFAULT_OSGEO4W_HOME_DIR}/include)
+
+SET(SPATIALINDEX_NAMES spatialindex ${OSGEO4W_IMPORT_LIBRARY})
+FIND_LIBRARY(SPATIALINDEX_LIBRARY
+    NAMES ${SPATIALINDEX_NAMES}
+    PATHS
+    ${DEFAULT_OSGEO4W_HOME_DIR}/lib)
 
 # Handle the QUIETLY and REQUIRED arguments and set SPATIALINDEX_FOUND to TRUE
 # if all listed variables are TRUE


More information about the Liblas-commits mailing list