Skip to content
Permalink
Browse files
fix cmake warning and report GDAL version
  • Loading branch information
jef-n committed May 17, 2012
1 parent f48a4bf commit 260d76b8859663ce6c6bf79cb62526a6ea8dc49d
Showing with 6 additions and 3 deletions.
  1. +6 −3 cmake/FindGDAL.cmake
@@ -61,7 +61,7 @@ ELSE(WIN32)
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GDAL_VERSION_MINOR "${GDAL_VERSION}")
IF (GDAL_VERSION_MAJOR LESS 1 OR (GDAL_VERSION EQUAL 1 AND GDAL_VERSION_MINOR LESS 4))
MESSAGE (FATAL_ERROR "GDAL version is too old (${GDAL_VERSION}). Use 1.4.0 or higher.")
ENDIF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)
ENDIF (GDAL_VERSION_MAJOR LESS 1 OR (GDAL_VERSION EQUAL 1 AND GDAL_VERSION_MINOR LESS 4))
ENDIF (GDAL_LIBRARY)
SET (CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
ENDIF ()
@@ -97,7 +97,7 @@ ELSE(WIN32)
# According to INSTALL, 1.4.0+ is required
IF (GDAL_VERSION_MAJOR LESS 1 OR (GDAL_VERSION_MAJOR EQUAL 1 AND GDAL_VERSION_MINOR LESS 4))
MESSAGE (FATAL_ERROR "GDAL version is too old (${GDAL_VERSION}). Use 1.4.0 or higher.")
ENDIF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)
ENDIF (GDAL_VERSION_MAJOR LESS 1 OR (GDAL_VERSION_MAJOR EQUAL 1 AND GDAL_VERSION_MINOR LESS 4))

# set INCLUDE_DIR to prefix+include
EXEC_PROGRAM(${GDAL_CONFIG}
@@ -172,7 +172,10 @@ ENDIF (GDAL_INCLUDE_DIR AND GDAL_LIBRARY)
IF (GDAL_FOUND)

IF (NOT GDAL_FIND_QUIETLY)
MESSAGE(STATUS "Found GDAL: ${GDAL_LIBRARY}")
FILE(READ ${GDAL_INCLUDE_DIR}/gdal_version.h gdal_version)
STRING(REGEX REPLACE "^.*GDAL_RELEASE_NAME +\"([^\"]+)\".*$" "\\1" GDAL_RELEASE_NAME "${gdal_version}")

MESSAGE(STATUS "Found GDAL: ${GDAL_LIBRARY} (${GDAL_RELEASE_NAME})")
ENDIF (NOT GDAL_FIND_QUIETLY)

ELSE (GDAL_FOUND)

0 comments on commit 260d76b

Please sign in to comment.