diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-02-10 20:24:32 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-02-11 14:46:10 (GMT) |
commit | 1b2774450d346da0e817cdd3e7b909f817ab450f (patch) | |
tree | 000d89ab89b9e958ce5f2c204154aaaf3d1ba18b /Modules | |
parent | 1621cb3eb19fc27e2cec78448f7ef75688d071b3 (diff) | |
download | CMake-1b2774450d346da0e817cdd3e7b909f817ab450f.zip CMake-1b2774450d346da0e817cdd3e7b909f817ab450f.tar.gz CMake-1b2774450d346da0e817cdd3e7b909f817ab450f.tar.bz2 |
FindGDAL: add support for skipping gdal-config
This can be confusing if there are autotools and CMake-built GDAL builds
within the same environment as the autotools variant will always be
preferred.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindGDAL.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake index 012024b..03d353d 100644 --- a/Modules/FindGDAL.cmake +++ b/Modules/FindGDAL.cmake @@ -45,6 +45,13 @@ Hints Set ``GDAL_DIR`` or ``GDAL_ROOT`` in the environment to specify the GDAL installation prefix. + +The following variables may be set to modify the search strategy: + +``FindGDAL_SKIP_GDAL_CONFIG`` + If set, ``gdal-config`` will not be used. This can be useful if there are + GDAL libraries built with autotools (which provide the tool) and CMake (which + do not) in the same environment. #]=======================================================================] # $GDALDIR is an environment variable that would @@ -75,7 +82,7 @@ find_path(GDAL_INCLUDE_DIR gdal.h ) mark_as_advanced(GDAL_INCLUDE_DIR) -if(UNIX) +if(UNIX AND NOT FindGDAL_SKIP_GDAL_CONFIG) # Use gdal-config to obtain the library version (this should hopefully # allow us to -lgdal1.x.y where x.y are correct version) # For some reason, libgdal development packages do not contain |