2021-10-20 03:26:37 +02:00
|
|
|
vcpkg_from_github(
|
2020-11-20 10:29:25 -08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-10-20 03:26:37 +02:00
|
|
|
REPO OSGeo/gdal
|
2022-07-08 00:05:52 +02:00
|
|
|
REF v3.5.1
|
|
|
|
SHA512 658e515a16ed2b45a0b3dffa6bb23f28d6454a902d8d9efbed320e353112463ff8e9c3efd5b6c98cf61cf187dc88a0dd13f4989041acc836de2b9c07e8da32e9
|
2021-10-20 03:26:37 +02:00
|
|
|
HEAD_REF master
|
2022-05-07 02:13:42 +02:00
|
|
|
PATCHES
|
2022-07-08 00:05:52 +02:00
|
|
|
find-link-libraries.patch
|
2021-10-20 03:26:37 +02:00
|
|
|
)
|
2021-10-21 06:57:13 +02:00
|
|
|
# `vcpkg clean` stumbles over one subdir
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/autotest")
|
2019-08-20 08:10:41 +08:00
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
# Cf. cmake/helpers/CheckDependentLibraries.cmake
|
|
|
|
# The default for all `GDAL_USE_<PKG>` dependencies is `OFF`.
|
|
|
|
# Here, we explicitly control dependencies provided via vpcpkg.
|
|
|
|
# "core" is used for a dependency which must be enabled to avoid vendored lib.
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
cfitsio GDAL_USE_CFITSIO
|
|
|
|
curl GDAL_USE_CURL
|
|
|
|
recommended-features GDAL_USE_EXPAT
|
|
|
|
freexl GDAL_USE_FREEXL
|
|
|
|
geos GDAL_USE_GEOS
|
|
|
|
core GDAL_USE_GEOTIFF
|
|
|
|
default-features GDAL_USE_GIF
|
|
|
|
hdf5 GDAL_USE_HDF5
|
|
|
|
default-features GDAL_USE_ICONV
|
|
|
|
default-features GDAL_USE_JPEG
|
|
|
|
core GDAL_USE_JSONC
|
|
|
|
lerc GDAL_USE_LERC
|
|
|
|
libkml GDAL_USE_LIBKML # TODO, needs policy patches to FindLibKML.cmake
|
|
|
|
default-features GDAL_USE_LIBLZMA
|
|
|
|
default-features GDAL_USE_LIBXML2
|
|
|
|
mysql-libmariadb GDAL_USE_MYSQL
|
|
|
|
netcdf GDAL_USE_NETCDF
|
|
|
|
odbc GDAL_USE_ODBC
|
|
|
|
default-features GDAL_USE_OPENJPEG
|
|
|
|
default-features GDAL_USE_OPENSSL
|
|
|
|
default-features GDAL_USE_PCRE2
|
|
|
|
default-features GDAL_USE_PNG
|
|
|
|
poppler GDAL_USE_POPPLER
|
|
|
|
postgresql GDAL_USE_POSTGRESQL
|
|
|
|
default-features GDAL_USE_QHULL
|
|
|
|
#core GDAL_USE_SHAPELIB # https://github.com/OSGeo/gdal/issues/5711, https://github.com/microsoft/vcpkg/issues/16041
|
|
|
|
core GDAL_USE_SHAPELIB_INTERNAL
|
|
|
|
libspatialite GDAL_USE_SPATIALITE
|
|
|
|
recommended-features GDAL_USE_SQLITE3
|
|
|
|
core GDAL_USE_TIFF
|
|
|
|
default-features GDAL_USE_WEBP
|
|
|
|
core GDAL_USE_ZLIB
|
|
|
|
default-features GDAL_USE_ZSTD
|
|
|
|
)
|
|
|
|
if(GDAL_USE_ICONV AND VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND FEATURE_OPTIONS -D_ICONV_SECOND_ARGUMENT_IS_NOT_CONST=ON)
|
|
|
|
endif()
|
2021-09-13 23:41:20 +02:00
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS_RELEASE
|
|
|
|
FEATURES
|
|
|
|
tools BUILD_APPS
|
|
|
|
)
|
2021-09-13 23:41:20 +02:00
|
|
|
|
2022-07-12 00:24:05 +02:00
|
|
|
# Compatibility with older Android versions https://github.com/OSGeo/gdal/pull/5941
|
|
|
|
if(VCPKG_TARGET_IS_ANDROID AND ANRDOID_PLATFORM VERSION_LESS 24 AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm"))
|
|
|
|
list(APPEND FEATURE_OPTIONS -DBUILD_WITHOUT_64BIT_OFFSET=ON)
|
|
|
|
endif()
|
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DBUILD_DOCS=OFF
|
|
|
|
-DBUILD_PYTHON_BINDINGS=OFF
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_CSharp=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Java=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=ON
|
|
|
|
-DGDAL_USE_INTERNAL_LIBS=OFF
|
|
|
|
-DGDAL_USE_EXTERNAL_LIBS=OFF
|
|
|
|
-DGDAL_BUILD_OPTIONAL_DRIVERS=ON
|
|
|
|
-DOGR_BUILD_OPTIONAL_DRIVERS=ON
|
|
|
|
-DGDAL_CHECK_PACKAGE_NetCDF_NAMES=netCDF
|
|
|
|
-DGDAL_CHECK_PACKAGE_NetCDF_TARGETS=netCDF::netcdf
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
${FEATURE_OPTIONS_RELEASE}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DBUILD_APPS=OFF
|
|
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/gdal)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/gdal/GDALConfig.cmake"
|
|
|
|
"include(CMakeFindDependencyMacro)"
|
|
|
|
"include(CMakeFindDependencyMacro)
|
|
|
|
# gdal needs a pkg-config tool. A host dependency provides pkgconf.
|
|
|
|
get_filename_component(vcpkg_host_prefix \"\${CMAKE_CURRENT_LIST_DIR}/../../../${HOST_TRIPLET}\" ABSOLUTE)
|
|
|
|
list(APPEND CMAKE_PROGRAM_PATH \"\${vcpkg_host_prefix}/tools/pkgconf\")"
|
|
|
|
)
|
2021-09-13 23:41:20 +02:00
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
if (BUILD_APPS)
|
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES
|
|
|
|
gdalinfo
|
|
|
|
gdalbuildvrt
|
|
|
|
gdaladdo
|
2021-09-13 23:41:20 +02:00
|
|
|
gdal_grid
|
|
|
|
gdal_translate
|
2022-07-08 00:05:52 +02:00
|
|
|
gdal_rasterize
|
|
|
|
gdalsrsinfo
|
2021-09-13 23:41:20 +02:00
|
|
|
gdalenhance
|
|
|
|
gdalmanage
|
|
|
|
gdaltransform
|
2022-07-08 00:05:52 +02:00
|
|
|
gdaltindex
|
|
|
|
gdaldem
|
|
|
|
gdal_create
|
|
|
|
gdal_viewshed
|
2021-09-13 23:41:20 +02:00
|
|
|
nearblack
|
|
|
|
ogrlineref
|
|
|
|
ogrtindex
|
2022-07-08 00:05:52 +02:00
|
|
|
gdalwarp
|
|
|
|
gdal_contour
|
|
|
|
gdallocationinfo
|
|
|
|
ogrinfo
|
|
|
|
ogr2ogr
|
|
|
|
ogrlineref
|
|
|
|
nearblack
|
|
|
|
gdalmdiminfo
|
|
|
|
gdalmdimtranslate
|
|
|
|
gnmanalyse
|
|
|
|
gnmmanage
|
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
|
|
|
endif()
|
2021-09-13 23:41:20 +02:00
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
)
|
|
|
|
file(GLOB bin_files "${CURRENT_PACKAGES_DIR}/bin/*")
|
|
|
|
list(REMOVE_ITEM bin_files "${CURRENT_PACKAGES_DIR}/bin/gdal-config")
|
|
|
|
if(NOT bin_files)
|
2020-11-20 10:29:25 -08:00
|
|
|
file(REMOVE_RECURSE
|
2022-07-08 00:05:52 +02:00
|
|
|
"${CURRENT_PACKAGES_DIR}/bin"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin"
|
|
|
|
)
|
2016-11-23 18:30:50 +01:00
|
|
|
endif()
|
2016-11-30 10:26:18 +01:00
|
|
|
|
2022-07-15 21:19:38 +02:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/cpl_config.h" "#define GDAL_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "")
|
|
|
|
|
2022-07-08 00:05:52 +02:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-01-18 21:15:31 +01:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-07-08 00:05:52 +02:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|