2021-10-20 09:26:37 +08:00
|
|
|
vcpkg_from_github(
|
2020-11-21 02:29:25 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-10-20 09:26:37 +08:00
|
|
|
REPO OSGeo/gdal
|
2022-11-24 02:01:01 +08:00
|
|
|
REF "v${VERSION}"
|
2024-11-11 16:25:15 +08:00
|
|
|
SHA512 4e0431c9bb9b7c54508afdcaa936445eee8878aa47f404e2ff00c8ce786c1dd58247c2cee76cb0e0e26cef04419d7c6c4884f2d9078e9d292c4a1c720deae3ed
|
2021-10-20 09:26:37 +08:00
|
|
|
HEAD_REF master
|
2022-05-07 08:13:42 +08:00
|
|
|
PATCHES
|
2022-07-08 06:05:52 +08:00
|
|
|
find-link-libraries.patch
|
2022-09-26 14:25:17 +08:00
|
|
|
fix-gdal-target-interfaces.patch
|
2023-01-17 04:45:42 +08:00
|
|
|
libkml.patch
|
2023-12-28 07:39:57 +08:00
|
|
|
target-is-valid.patch
|
2024-11-20 06:42:29 +08:00
|
|
|
remove-machine-flag.patch
|
2021-10-20 09:26:37 +08:00
|
|
|
)
|
2021-10-21 12:57:13 +08:00
|
|
|
# `vcpkg clean` stumbles over one subdir
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/autotest")
|
2019-08-20 08:10:41 +08:00
|
|
|
|
2023-06-07 07:21:01 +08:00
|
|
|
# Avoid abseil, no matter if vcpkg or system
|
|
|
|
vcpkg_replace_string("${SOURCE_PATH}/ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base.h" [[__has_include("absl/strings/string_view.h")]] "(0)")
|
|
|
|
|
2022-07-08 06:05:52 +08: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
|
2024-11-06 04:34:14 +08:00
|
|
|
archive GDAL_USE_ARCHIVE
|
2022-07-08 06:05:52 +08:00
|
|
|
cfitsio GDAL_USE_CFITSIO
|
|
|
|
curl GDAL_USE_CURL
|
2022-11-19 05:03:52 +08:00
|
|
|
expat GDAL_USE_EXPAT
|
2022-07-08 06:05:52 +08:00
|
|
|
freexl GDAL_USE_FREEXL
|
|
|
|
geos GDAL_USE_GEOS
|
|
|
|
core GDAL_USE_GEOTIFF
|
2022-11-19 05:03:52 +08:00
|
|
|
gif GDAL_USE_GIF
|
2022-07-08 06:05:52 +08:00
|
|
|
hdf5 GDAL_USE_HDF5
|
2022-11-19 05:03:52 +08:00
|
|
|
iconv GDAL_USE_ICONV
|
|
|
|
jpeg GDAL_USE_JPEG
|
2022-07-08 06:05:52 +08:00
|
|
|
core GDAL_USE_JSONC
|
2023-12-28 07:39:57 +08:00
|
|
|
kea GDAL_USE_KEA
|
2022-07-08 06:05:52 +08:00
|
|
|
lerc GDAL_USE_LERC
|
2023-01-17 04:45:42 +08:00
|
|
|
libkml GDAL_USE_LIBKML
|
2022-11-19 05:03:52 +08:00
|
|
|
lzma GDAL_USE_LIBLZMA
|
|
|
|
libxml2 GDAL_USE_LIBXML2
|
2022-07-08 06:05:52 +08:00
|
|
|
mysql-libmariadb GDAL_USE_MYSQL
|
|
|
|
netcdf GDAL_USE_NETCDF
|
|
|
|
odbc GDAL_USE_ODBC
|
2022-11-19 05:03:52 +08:00
|
|
|
openjpeg GDAL_USE_OPENJPEG
|
|
|
|
openssl GDAL_USE_OPENSSL
|
|
|
|
pcre2 GDAL_USE_PCRE2
|
|
|
|
png GDAL_USE_PNG
|
2022-07-08 06:05:52 +08:00
|
|
|
poppler GDAL_USE_POPPLER
|
|
|
|
postgresql GDAL_USE_POSTGRESQL
|
2022-11-19 05:03:52 +08:00
|
|
|
qhull GDAL_USE_QHULL
|
2022-07-08 06:05:52 +08:00
|
|
|
#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
|
2022-11-19 05:03:52 +08:00
|
|
|
sqlite3 GDAL_USE_SQLITE3
|
2022-07-08 06:05:52 +08:00
|
|
|
core GDAL_USE_TIFF
|
2022-11-19 05:03:52 +08:00
|
|
|
webp GDAL_USE_WEBP
|
2022-07-08 06:05:52 +08:00
|
|
|
core GDAL_USE_ZLIB
|
2022-11-19 05:03:52 +08:00
|
|
|
zstd GDAL_USE_ZSTD
|
2022-09-26 14:25:17 +08:00
|
|
|
tools BUILD_APPS
|
2023-08-12 02:04:06 +08:00
|
|
|
INVERTED_FEATURES
|
|
|
|
libspatialite CMAKE_DISABLE_FIND_PACKAGE_SPATIALITE
|
2022-07-08 06:05:52 +08:00
|
|
|
)
|
|
|
|
if(GDAL_USE_ICONV AND VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND FEATURE_OPTIONS -D_ICONV_SECOND_ARGUMENT_IS_NOT_CONST=ON)
|
|
|
|
endif()
|
2021-09-14 05:41:20 +08:00
|
|
|
|
2022-07-12 06:24:05 +08: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-08-23 00:33:47 +08:00
|
|
|
string(REPLACE "dynamic" "" qhull_target "Qhull::qhull${VCPKG_LIBRARY_LINKAGE}_r")
|
|
|
|
|
2022-07-08 06:05:52 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
2022-09-26 14:25:17 +08:00
|
|
|
-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET} # for host pkgconf in PATH
|
2022-07-08 06:05:52 +08:00
|
|
|
${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_SWIG=ON
|
2023-08-18 03:59:50 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Arrow=ON
|
2022-07-08 06:05:52 +08:00
|
|
|
-DGDAL_USE_INTERNAL_LIBS=OFF
|
|
|
|
-DGDAL_USE_EXTERNAL_LIBS=OFF
|
|
|
|
-DGDAL_BUILD_OPTIONAL_DRIVERS=ON
|
|
|
|
-DOGR_BUILD_OPTIONAL_DRIVERS=ON
|
2023-12-28 07:39:57 +08:00
|
|
|
-DFIND_PACKAGE2_KEA_ENABLED=OFF
|
2022-09-26 14:25:17 +08:00
|
|
|
-DGDAL_CHECK_PACKAGE_MySQL_NAMES=unofficial-libmariadb
|
|
|
|
-DGDAL_CHECK_PACKAGE_MySQL_TARGETS=unofficial::libmariadb
|
|
|
|
-DMYSQL_LIBRARIES=unofficial::libmariadb
|
2022-07-08 06:05:52 +08:00
|
|
|
-DGDAL_CHECK_PACKAGE_NetCDF_NAMES=netCDF
|
|
|
|
-DGDAL_CHECK_PACKAGE_NetCDF_TARGETS=netCDF::netcdf
|
2022-08-23 00:33:47 +08:00
|
|
|
-DGDAL_CHECK_PACKAGE_QHULL_NAMES=Qhull
|
|
|
|
"-DGDAL_CHECK_PACKAGE_QHULL_TARGETS=${qhull_target}"
|
|
|
|
"-DQHULL_LIBRARY=${qhull_target}"
|
2023-06-27 11:24:50 +08:00
|
|
|
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
2022-07-08 06:05:52 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DBUILD_APPS=OFF
|
2022-11-02 10:54:40 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
QHULL_LIBRARY
|
2022-07-08 06:05:52 +08:00
|
|
|
)
|
|
|
|
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-14 05:41:20 +08:00
|
|
|
|
2022-07-08 06:05:52 +08:00
|
|
|
if (BUILD_APPS)
|
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES
|
2023-11-17 11:48:18 +08:00
|
|
|
gdal_contour
|
|
|
|
gdal_create
|
|
|
|
gdal_footprint
|
2021-09-14 05:41:20 +08:00
|
|
|
gdal_grid
|
2022-07-08 06:05:52 +08:00
|
|
|
gdal_rasterize
|
2023-11-17 11:48:18 +08:00
|
|
|
gdal_translate
|
2022-07-08 06:05:52 +08:00
|
|
|
gdal_viewshed
|
2023-11-17 11:48:18 +08:00
|
|
|
gdaladdo
|
|
|
|
gdalbuildvrt
|
|
|
|
gdaldem
|
|
|
|
gdalenhance
|
|
|
|
gdalinfo
|
2022-07-08 06:05:52 +08:00
|
|
|
gdallocationinfo
|
2023-11-17 11:48:18 +08:00
|
|
|
gdalmanage
|
2022-07-08 06:05:52 +08:00
|
|
|
gdalmdiminfo
|
|
|
|
gdalmdimtranslate
|
2023-11-17 11:48:18 +08:00
|
|
|
gdalsrsinfo
|
|
|
|
gdaltindex
|
|
|
|
gdaltransform
|
|
|
|
gdalwarp
|
2022-07-08 06:05:52 +08:00
|
|
|
gnmanalyse
|
|
|
|
gnmmanage
|
2023-11-17 11:48:18 +08:00
|
|
|
nearblack
|
|
|
|
ogr2ogr
|
|
|
|
ogrinfo
|
|
|
|
ogrlineref
|
|
|
|
ogrtindex
|
2023-05-25 03:20:14 +08:00
|
|
|
sozip
|
2022-07-08 06:05:52 +08:00
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
|
|
|
endif()
|
2021-09-14 05:41:20 +08:00
|
|
|
|
2022-07-08 06:05:52 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
)
|
2022-07-20 00:58:50 +08:00
|
|
|
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/gdal-config" "${CURRENT_PACKAGES_DIR}/debug/bin/gdal-config")
|
|
|
|
|
2022-07-08 06:05:52 +08:00
|
|
|
file(GLOB bin_files "${CURRENT_PACKAGES_DIR}/bin/*")
|
|
|
|
if(NOT bin_files)
|
2020-11-21 02:29:25 +08:00
|
|
|
file(REMOVE_RECURSE
|
2022-07-08 06:05:52 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/bin"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin"
|
|
|
|
)
|
2016-11-24 01:30:50 +08:00
|
|
|
endif()
|
2016-11-30 17:26:18 +08:00
|
|
|
|
2022-07-16 03:19:38 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/cpl_config.h" "#define GDAL_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "")
|
|
|
|
|
2022-07-08 06:05:52 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-01-19 04:15:31 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-09-26 14:48:02 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.TXT")
|