<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,11 +14,21 @@
 #
 ###############################################################################
 MESSAGE(STATUS &quot;Searching for GDAL ${GDAL_FIND_VERSION}+ library&quot;)
+MESSAGE(STATUS &quot;   NOTE: Required version is not checked - to be implemented&quot;)
 
 SET(GDAL_NAMES gdal)
 
 IF(WIN32)
 
+    SET(OSGEO4W_IMPORT_LIBRARY gdal_i)
+    IF($ENV{OSGEO4W_ROOT})
+        SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+        MESSAGE(STATUS &quot;Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}&quot;)
+    ELSE()
+        SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+        MESSAGE(STATUS &quot;Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}&quot;)
+    ENDIF()
+
     IF(MINGW)
         FIND_PATH(GDAL_INCLUDE_DIR
             gdal.h
@@ -26,7 +36,8 @@ IF(WIN32)
             PATHS
             /usr/local/include
             /usr/include
-            c:/msys/local/include)
+            c:/msys/local/include
+            ${OSGEO4W_ROOT_DIR}/include)
 
         FIND_LIBRARY(GDAL_LIBRARY
             NAMES ${GDAL_NAMES}
@@ -34,21 +45,28 @@ IF(WIN32)
             PATHS
             /usr/local/lib
             /usr/lib
-            c:/msys/local/lib)
+            c:/msys/local/lib
+            ${OSGEO4W_ROOT_DIR}/lib)
     ENDIF(MINGW)
 
     IF(MSVC)
-        SET(GDAL_INCLUDE_DIR &quot;$ENV{LIB_DIR}/include/gdal&quot; CACHE STRING INTERNAL)
 
+        FIND_PATH(GDAL_INCLUDE_DIR
+            NAMES gdal.h 
+            PATH_PREFIXES gdal gdal-1.6
+            PATHS
+            &quot;$ENV{LIB_DIR}/include/gdal&quot;
+            ${OSGEO4W_ROOT_DIR}/include)
 
-        SET(GDAL_NAMES ${GDAL_NAMES} gdal_I)
+        SET(GDAL_NAMES ${OSGEO4W_IMPORT_LIBRARY} ${GDAL_NAMES})
         FIND_LIBRARY(GDAL_LIBRARY
             NAMES ${GDAL_NAMES}
             PATH_PREFIXES gdal gdal-1.6
             PATHS
             &quot;$ENV{LIB_DIR}/lib&quot;
             /usr/lib
-            c:/msys/local/lib)
+            c:/msys/local/lib
+            ${OSGEO4W_ROOT_DIR}/lib)
         
         IF(GDAL_LIBRARY)
             SET(GDAL_LIBRARY;odbc32;odbccp32 CACHE STRING INTERNAL)</diff>
      <filename>cmake/modules/FindGDAL.cmake</filename>
    </modified>
    <modified>
      <diff>@@ -1,71 +1,59 @@
-###############################################################################
-#
-# CMake module to search for GeoTIFF library
-#
-# On success, the macro sets the following variables:
-# GEOTIFF_FOUND       = if the library found
-# GEOTIFF_LIBRARIES   = full path to the library
-# GEOTIFF_INCLUDE_DIR = where to find the library headers 
-# also defined, but not for general use are
-# GEOTIFF_LIBRARY, where to find the PROJ.4 library.
-#
-# Copyright (c) 2009 Mateusz Loskot &lt;mateusz@loskot.net&gt;
-#
-# 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.
-#
-###############################################################################
-
-SET(GEOTIFF_NAMES geotiff)
-
-IF(WIN32)
-
-    IF(MINGW)
-        FIND_PATH(GEOTIFF_INCLUDE_DIR
-            geotiff.h
-            PATH_PREFIXES geotiff
-            PATHS
-            /usr/local/include
-            /usr/include
-            c:/msys/local/include)
-
-        FIND_LIBRARY(GEOTIFF_LIBRARY
-            NAMES ${GEOTIFF_NAMES}
-            PATHS
-            /usr/local/lib
-            /usr/lib
-            c:/msys/local/lib)
-    ENDIF(MINGW)
-
-    IF(MSVC)
-        SET(GEOTIFF_INCLUDE_DIR &quot;$ENV{LIB_DIR}/include&quot; CACHE STRING INTERNAL)
-
-        SET(GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i)
-        FIND_LIBRARY(GEOTIFF_LIBRARY NAMES 
-            NAMES ${GEOTIFF_NAMES}
-            PATHS
-            &quot;$ENV{LIB_DIR}/lib&quot;
-            /usr/lib
-            c:/msys/local/lib)
-    ENDIF(MSVC)
-  
-ELSEIF(UNIX)
-
-    FIND_PATH(GEOTIFF_INCLUDE_DIR geotiff.h PATH_PREFIXES geotiff)
-
-    FIND_LIBRARY(GEOTIFF_LIBRARY NAMES ${GEOTIFF_NAMES})
-
-ELSE()
-    MESSAGE(&quot;FindGeoTIFF.cmake: unrecognized or unsupported operating system&quot;)
-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)
+###############################################################################
+#
+# CMake module to search for GeoTIFF library
+#
+# On success, the macro sets the following variables:
+# GEOTIFF_FOUND       = if the library found
+# GEOTIFF_LIBRARIES   = full path to the library
+# GEOTIFF_INCLUDE_DIR = where to find the library headers 
+# also defined, but not for general use are
+# GEOTIFF_LIBRARY, where to find the PROJ.4 library.
+#
+# Copyright (c) 2009 Mateusz Loskot &lt;mateusz@loskot.net&gt;
+#
+# 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 &quot;Searching for GeoTIFF ${GeoTIFF_FIND_VERSION}+ library&quot;)
+MESSAGE(STATUS &quot;   NOTE: Required version is not checked - to be implemented&quot;)
+
+IF(GEOTIFF_INCLUDE_DIR)
+    # Already in cache, be silent
+    SET(GEOTIFF_FIND_QUIETLY TRUE)
+ENDIF()
+
+IF(WIN32)
+    SET(OSGEO4W_IMPORT_LIBRARY geotiff_i)
+    IF($ENV{OSGEO4W_ROOT})
+        SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+        MESSAGE(STATUS &quot;Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}&quot;)
+    ELSE()
+        SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+        MESSAGE(STATUS &quot;Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}&quot;)
+    ENDIF()
+ENDIF()
+     
+FIND_PATH(GEOTIFF_INCLUDE_DIR
+    geotiff.h
+    PATH_PREFIXES geotiff
+    PATHS
+    ${OSGEO4W_ROOT_DIR}/include)
+
+SET(GEOTIFF_NAMES ${OSGEO4W_IMPORT_LIBRARY} geotiff)
+
+FIND_LIBRARY(GEOTIFF_LIBRARY
+    NAMES ${GEOTIFF_NAMES}
+    PATHS
+    ${OSGEO4W_ROOT_DIR}/lib)
+
+IF(GEOTIFF_FOUND)
+  SET(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY})
+ENDIF()
+
+# Handle the QUIETLY and REQUIRED arguments and set GEOTIFF_FOUND to TRUE
+# if all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)</diff>
      <filename>cmake/modules/FindGeoTIFF.cmake</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,44 @@
-###############################################################################
-# CMake module to search for PROJ.4 library
-#
-# On success, the macro sets the following variables:
-# PROJ4_FOUND       = if the library found
-# PROJ4_LIBRARY     = full path to the library
-# PROJ4_INCLUDE_DIR = where to find the library headers 
-# also defined, but not for general use are
-# PROJ4_LIBRARY, where to find the PROJ.4 library.
-#
-# Copyright (c) 2009 Mateusz Loskot &lt;mateusz@loskot.net&gt;
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-###############################################################################
-
-# Try to use OSGeo4W installation
-IF(WIN32)
-    SET(PROJ4_OSGEO4W_HOME &quot;C:/OSGeo4W&quot;) 
-
-    IF($ENV{OSGEO4W_HOME})
-        SET(PROJ4_OSGEO4W_HOME &quot;$ENV{OSGEO4W_HOME}&quot;) 
-    ENDIF()
-ENDIF(WIN32)
-
-FIND_PATH(PROJ4_INCLUDE_DIR proj_api.h
-    PATHS ${PROJ4_OSGEO4W_HOME}/include
-    DOC &quot;Path to PROJ.4 library include directory&quot;)
-
-SET(PROJ4_NAMES ${PROJ4_NAMES} proj proj_i)
-FIND_LIBRARY(PROJ4_LIBRARY
-    NAMES ${PROJ4_NAMES}
-    PATHS ${PROJ4_OSGEO4W_HOME}/lib
-    DOC &quot;Path to PROJ.4 library file&quot;)
-
-# 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(PROJ4 DEFAULT_MSG PROJ4_LIBRARY PROJ4_INCLUDE_DIR)
-
-IF(PROJ4_FOUND)
-  SET(PROJ4_LIBRARIES ${PROJ4_LIBRARY})
-ENDIF()
+###############################################################################
+# CMake module to search for PROJ.4 library
+#
+# On success, the macro sets the following variables:
+# PROJ4_FOUND       = if the library found
+# PROJ4_LIBRARY     = full path to the library
+# PROJ4_INCLUDE_DIR = where to find the library headers 
+# also defined, but not for general use are
+# PROJ4_LIBRARY, where to find the PROJ.4 library.
+#
+# Copyright (c) 2009 Mateusz Loskot &lt;mateusz@loskot.net&gt;
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+###############################################################################
+
+# Try to use OSGeo4W installation
+IF(WIN32)
+    SET(PROJ4_OSGEO4W_HOME &quot;C:/OSGeo4W&quot;) 
+
+    IF($ENV{OSGEO4W_HOME})
+        SET(PROJ4_OSGEO4W_HOME &quot;$ENV{OSGEO4W_HOME}&quot;) 
+    ENDIF()
+ENDIF(WIN32)
+
+FIND_PATH(PROJ4_INCLUDE_DIR proj_api.h
+    PATHS ${PROJ4_OSGEO4W_HOME}/include
+    DOC &quot;Path to PROJ.4 library include directory&quot;)
+
+SET(PROJ4_NAMES ${PROJ4_NAMES} proj proj_i)
+FIND_LIBRARY(PROJ4_LIBRARY
+    NAMES ${PROJ4_NAMES}
+    PATHS ${PROJ4_OSGEO4W_HOME}/lib
+    DOC &quot;Path to PROJ.4 library file&quot;)
+
+# 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(PROJ4 DEFAULT_MSG PROJ4_LIBRARY PROJ4_INCLUDE_DIR)
+
+IF(PROJ4_FOUND)
+  SET(PROJ4_LIBRARIES ${PROJ4_LIBRARY})
+ENDIF()</diff>
      <filename>cmake/modules/FindPROJ4.cmake</filename>
    </modified>
    <modified>
      <diff>@@ -24,10 +24,10 @@ IF(WIN32)
     SET(OSGEO4W_IMPORT_LIBRARY spatialindex_i)
     IF($ENV{OSGEO4W_ROOT})
         SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
-        MESSAGE(STATUS &quot;Trying environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}&quot;)
+        MESSAGE(STATUS &quot;Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}&quot;)
     ELSE()
         SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
-        MESSAGE(STATUS &quot;Trying default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}&quot;)
+        MESSAGE(STATUS &quot;Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}&quot;)
     ENDIF()
 ENDIF()
 </diff>
      <filename>cmake/modules/FindSpatialIndex.cmake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1f6615a9ff8c937c9f4f52dd7b9820e9d9a98607</id>
    </parent>
  </parents>
  <author>
    <name>Mateusz Loskot</name>
    <email>mateusz@loskot.net</email>
  </author>
  <url>http://github.com/mloskot/workshop/commit/595d04a66b7b1b014cbb38668b60366a33126f7e</url>
  <id>595d04a66b7b1b014cbb38668b60366a33126f7e</id>
  <committed-date>2009-10-19T13:55:39-07:00</committed-date>
  <authored-date>2009-10-19T13:55:39-07:00</authored-date>
  <message>[cmake] Added OSGeo4W support to FindGeoTIFF.cmake and FindGDAL.cmake. Improved SpatialIndex.cmake</message>
  <tree>907465b7ae8dc8ce5bf7f654765728fe9c27e8ed</tree>
  <committer>
    <name>Mateusz Loskot</name>
    <email>mateusz@loskot.net</email>
  </committer>
</commit>
