Skip to content

Commit f10517f

Browse files
author
timlinux
committedNov 19, 2008
Patch from strk to specify minimum gdal of 1.4
git-svn-id: http://svn.osgeo.org/qgis/trunk@9672 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e9f6cec commit f10517f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
 

‎cmake/FindGDAL.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ ELSE(WIN32)
4949
# MESSAGE("DBG GDAL_CONFIG ${GDAL_CONFIG}")
5050

5151
IF (GDAL_CONFIG)
52+
53+
## extract gdal version
54+
EXEC_PROGRAM(${GDAL_CONFIG}
55+
ARGS --version
56+
OUTPUT_VARIABLE GDAL_VERSION )
57+
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" GDAL_VERSION_MAJOR "${GDAL_VERSION}")
58+
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GDAL_VERSION_MINOR "${GDAL_VERSION}")
59+
60+
# MESSAGE("DBG GDAL_VERSION ${GDAL_VERSION}")
61+
# MESSAGE("DBG GDAL_VERSION_MAJOR ${GDAL_VERSION_MAJOR}")
62+
# MESSAGE("DBG GDAL_VERSION_MINOR ${GDAL_VERSION_MINOR}")
63+
64+
# check for gdal version
65+
# version 1.2.5 is known NOT to be supported (missing CPL_STDCALL macro)
66+
# According to INSTALL, 1.4.0+ is required
67+
IF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)
68+
MESSAGE (FATAL_ERROR "GDAL version is too old (${GDAL_VERSION}). Use 1.4.0 or higher.")
69+
ENDIF (GDAL_VERSION_MAJOR LESS 1 OR GDAL_VERSION_MINOR LESS 4)
70+
5271
# set INCLUDE_DIR to prefix+include
5372
EXEC_PROGRAM(${GDAL_CONFIG}
5473
ARGS --prefix

0 commit comments

Comments
 (0)
Please sign in to comment.