Skip to content

Commit

Permalink
Merge pull request #8821 from OSGeo/backport-8810-to-release/3.8
Browse files Browse the repository at this point in the history
[Backport release/3.8] CMake: make GDAL_USE_LIBKML and GDAL_USE_OPENJPEG honor GDAL_USE_EXTERNAL_LIBS
  • Loading branch information
rouault authored Nov 28, 2023
2 parents c0cd9c6 + 55841ba commit cec9364
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions cmake/helpers/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,7 @@ endfunction()
gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE)
gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE)

find_package(LibKML COMPONENTS DOM ENGINE)
if (GDAL_USE_LIBKML)
if (NOT LibKML_FOUND)
message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found")
endif ()
endif ()
cmake_dependent_option(GDAL_USE_LIBKML "Set ON to use LibKML" ON LibKML_FOUND OFF)
if (GDAL_USE_LIBKML)
string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(LibKML COMPONENTS DOM ENGINE)\n")
endif ()
gdal_check_package(LibKML "Use LIBKML library" COMPONENTS DOM ENGINE CAN_DISABLE)

define_find_package2(KEA libkea/KEACommon.h kea;libkea)
gdal_check_package(KEA "Enable KEA driver" CAN_DISABLE)
Expand Down Expand Up @@ -742,7 +733,7 @@ if (GDAL_USE_OPENJPEG)
message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found")
endif ()
endif ()
cmake_dependent_option(GDAL_USE_OPENJPEG "Set ON to use openjpeg" ON OPENJPEG_FOUND OFF)
cmake_dependent_option(GDAL_USE_OPENJPEG "Set ON to use openjpeg" ${GDAL_USE_EXTERNAL_LIBS} OPENJPEG_FOUND OFF)
if (GDAL_USE_OPENJPEG)
string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(OpenJPEG MODULE)\n")
endif ()
Expand Down

0 comments on commit cec9364

Please sign in to comment.