File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,25 @@ ELSE(WIN32)
49
49
# MESSAGE("DBG GDAL_CONFIG ${GDAL_CONFIG}")
50
50
51
51
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
+
52
71
# set INCLUDE_DIR to prefix+include
53
72
EXEC_PROGRAM (${GDAL_CONFIG}
54
73
ARGS --prefix
You can’t perform that action at this time.
0 commit comments