diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt index 3d0110ef48..893a2c1c91 100644 --- a/modules/imgcodecs/CMakeLists.txt +++ b/modules/imgcodecs/CMakeLists.txt @@ -51,6 +51,7 @@ if(HAVE_OPENEXR) endif() if(HAVE_GDAL) + add_definitions(-DHAVE_GDAL) include_directories(SYSTEM ${GDAL_INCLUDE_DIR}) list(APPEND GRFMT_LIBS ${GDAL_LIBRARY}) endif() diff --git a/modules/imgcodecs/src/grfmt_gdal.cpp b/modules/imgcodecs/src/grfmt_gdal.cpp index f172f6f9aa..b0caa7bd09 100644 --- a/modules/imgcodecs/src/grfmt_gdal.cpp +++ b/modules/imgcodecs/src/grfmt_gdal.cpp @@ -38,6 +38,7 @@ // the use of this software, even if advised of the possibility of such damage. // //M*/ +#include "precomp.hpp" #include "grfmt_gdal.hpp" #ifdef HAVE_GDAL