2021-11-09 19:10:08 +01:00
|
|
|
set(GEOS_VERSION 3.10.0)
|
2017-09-26 22:29:24 +02:00
|
|
|
|
2016-10-16 20:22:00 -04:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2021-11-09 19:10:08 +01:00
|
|
|
URLS "https://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2"
|
2018-10-16 03:56:14 +02:00
|
|
|
FILENAME "geos-${GEOS_VERSION}.tar.bz2"
|
2021-11-09 19:10:08 +01:00
|
|
|
SHA512 12657c6649bfbf6efa3232a054969c6229bb23fc16a7c72d6ca5fdb662e0d08e14bbcaa6944a17de8972b6c236608d94c870ead0b04fada2d2af3d42c238058e
|
2016-10-16 20:22:00 -04:00
|
|
|
)
|
2018-10-16 03:56:14 +02:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-05-26 22:29:02 +02:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2018-10-16 03:56:14 +02:00
|
|
|
REF ${GEOS_VERSION}
|
2020-09-01 03:45:58 +03:00
|
|
|
PATCHES
|
2021-11-09 19:10:08 +01:00
|
|
|
disable-warning-4996.patch
|
|
|
|
fix-exported-config.patch
|
|
|
|
install-hpp-files.patch
|
2017-10-03 23:37:23 +05:00
|
|
|
)
|
2016-10-16 20:22:00 -04:00
|
|
|
|
2020-09-09 21:26:45 +02:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(_CMAKE_EXTRA_OPTIONS "-DDISABLE_GEOS_INLINE=ON")
|
|
|
|
else()
|
|
|
|
set(_CMAKE_EXTRA_OPTIONS "")
|
|
|
|
endif()
|
|
|
|
|
2021-05-26 22:29:02 +02:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-05-01 10:14:18 +02:00
|
|
|
OPTIONS
|
2021-11-09 19:10:08 +01:00
|
|
|
-DBUILD_ASTYLE=OFF
|
|
|
|
-DBUILD_DOCUMENTATION=OFF
|
|
|
|
-DBUILD_GEOSOP=OFF
|
2020-09-01 03:45:58 +03:00
|
|
|
-DBUILD_TESTING=OFF
|
2021-05-26 22:29:02 +02:00
|
|
|
-DBUILD_BENCHMARKS=OFF
|
2020-09-09 21:26:45 +02:00
|
|
|
${_CMAKE_EXTRA_OPTIONS}
|
2021-10-06 03:39:42 +02:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d # Legacy decision, hard coded in depending ports
|
2016-10-16 20:22:00 -04:00
|
|
|
)
|
2021-05-26 22:29:02 +02:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/GEOS)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2018-10-16 03:56:14 +02:00
|
|
|
|
2021-05-26 22:29:02 +02:00
|
|
|
function(geos_add_debug_postfix config_file)
|
|
|
|
file(READ "${config_file}" contents)
|
|
|
|
string(REGEX REPLACE "(-lgeos(_c)?)d?([^-_d])" "\\1d\\3" fixed_contents "${contents}")
|
|
|
|
file(WRITE "${config_file}" "${fixed_contents}")
|
|
|
|
endfunction()
|
2021-11-09 19:10:08 +01:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/geos-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/geos-config")
|
|
|
|
file(CHMOD "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/geos-config" FILE_PERMISSIONS
|
|
|
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
|
|
|
GROUP_READ GROUP_EXECUTE
|
|
|
|
WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
endif()
|
2021-05-26 22:29:02 +02:00
|
|
|
endif()
|
2021-11-09 19:10:08 +01:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
geos_add_debug_postfix("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/geos.pc")
|
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/geos-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/geos-config")
|
|
|
|
geos_add_debug_postfix("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/geos-config")
|
|
|
|
file(CHMOD "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/geos-config" FILE_PERMISSIONS
|
|
|
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
|
|
|
GROUP_READ GROUP_EXECUTE
|
|
|
|
WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
endif()
|
2018-12-13 13:06:27 +01:00
|
|
|
endif()
|
|
|
|
|
2021-05-26 22:29:02 +02:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2016-10-31 12:34:04 -07:00
|
|
|
endif()
|
|
|
|
|
2018-10-16 03:56:14 +02:00
|
|
|
# Handle copyright
|
2021-05-26 22:29:02 +02:00
|
|
|
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/geos/copyright" COPYONLY)
|
2018-10-16 03:56:14 +02:00
|
|
|
|
2017-10-04 05:36:30 -07:00
|
|
|
vcpkg_copy_pdbs()
|
2021-05-26 22:29:02 +02:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|