2020-09-01 08:45:58 +08:00
|
|
|
set(GEOS_VERSION 3.8.1)
|
2017-09-27 04:29:24 +08:00
|
|
|
|
2016-10-17 08:22:00 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2018-10-16 09:56:14 +08:00
|
|
|
URLS "http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2"
|
|
|
|
FILENAME "geos-${GEOS_VERSION}.tar.bz2"
|
2020-09-01 08:45:58 +08:00
|
|
|
SHA512 1d8d8b3ece70eb388ea128f4135c7455899f01828223b23890ad3a2401e27104efce03987676794273a9b9d4907c0add2be381ff14b8420aaa9a858cc5941056
|
2016-10-17 08:22:00 +08:00
|
|
|
)
|
2018-10-16 09:56:14 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${GEOS_VERSION}
|
2020-09-01 08:45:58 +08:00
|
|
|
PATCHES
|
|
|
|
dont-build-docs.patch
|
|
|
|
dont-build-astyle.patch
|
2017-10-04 02:37:23 +08:00
|
|
|
)
|
2016-10-17 08:22:00 +08:00
|
|
|
|
2017-09-27 04:29:24 +08:00
|
|
|
# NOTE: GEOS provides CMake as optional build configuration, it might not be actively
|
|
|
|
# maintained, so CMake build issues may happen between releases.
|
|
|
|
|
2020-09-10 03:26:45 +08:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(_CMAKE_EXTRA_OPTIONS "-DDISABLE_GEOS_INLINE=ON")
|
|
|
|
else()
|
|
|
|
set(_CMAKE_EXTRA_OPTIONS "")
|
|
|
|
endif()
|
|
|
|
|
2016-10-17 08:22:00 +08:00
|
|
|
vcpkg_configure_cmake(
|
2016-12-08 07:23:50 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-10-16 09:56:14 +08:00
|
|
|
PREFER_NINJA
|
2018-05-01 16:14:18 +08:00
|
|
|
OPTIONS
|
2018-10-16 09:56:14 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
2020-09-01 08:45:58 +08:00
|
|
|
-DBUILD_TESTING=OFF
|
2020-09-10 03:26:45 +08:00
|
|
|
${_CMAKE_EXTRA_OPTIONS}
|
2016-10-17 08:22:00 +08:00
|
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
2020-09-01 08:45:58 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GEOS)
|
2018-10-16 09:56:14 +08:00
|
|
|
|
2018-12-13 20:06:27 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
2016-10-17 08:22:00 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2018-10-16 09:56:14 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/geos-config)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/geos)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/geos-config ${CURRENT_PACKAGES_DIR}/share/geos/geos-config)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/geos-config)
|
2016-11-01 03:34:04 +08:00
|
|
|
endif()
|
|
|
|
|
2018-10-16 09:56:14 +08:00
|
|
|
# Handle copyright
|
|
|
|
configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright COPYONLY)
|
|
|
|
|
2017-10-04 20:36:30 +08:00
|
|
|
vcpkg_copy_pdbs()
|