From f48d05a25a2b6310b1c6852fa2add4820288aad4 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Sun, 16 Oct 2016 20:22:00 -0400 Subject: [PATCH] added geos --- ports/geos/CONTROL | 3 +++ ports/geos/portfile.cmake | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ports/geos/CONTROL create mode 100644 ports/geos/portfile.cmake diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL new file mode 100644 index 0000000000..c0ec7b1344 --- /dev/null +++ b/ports/geos/CONTROL @@ -0,0 +1,3 @@ +Source: geos +Version: 3.5.0 +Description: Geometry Engine Open Source diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake new file mode 100644 index 0000000000..554015937d --- /dev/null +++ b/ports/geos/portfile.cmake @@ -0,0 +1,45 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(${CMAKE_TRIPLET_FILE}) +include(vcpkg_common_functions) +#downloading 3.5 from their SVN repo and not the release tarball +#because the 3.5 release did not build on windows, and fixes were backported +#without generating a new release tarball (I don't think very many GIS people use win) +vcpkg_download_distfile(ARCHIVE + URLS "https://trac.osgeo.org/geos/browser/branches/3.5?rev=4261&format=zip" + FILENAME "geos-3.5.0.zip" + SHA512 3b91e8992f60b99a3f01069d955b71bce425ae5e5c599252fa26a337494e1a5a8ea796be124766d054710d6c03806f56dc1c63539b4660e2bb894d7ef779d4b9 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +#we need to do this because GOES deploy process is totally broken for cmake +#file(DOWNLOAD http://svn.osgeo.org/geos/tags/3.5.0/cmake/modules/GenerateSourceGroups.cmake +# ${CURRENT_BUILDTREES_DIR}/src/geos-3.5.0/cmake/modules/GenerateSourceGroups.cmake) +file(WRITE ${CURRENT_BUILDTREES_DIR}/src/3.5/geos_svn_revision.h "#define GEOS_SVN_REVISION 4261") +vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/3.5 + OPTIONS -DGEOS_ENABLE_TESTS=False + -DBUILD_TESTING=False +) + +vcpkg_build_cmake() +vcpkg_install_cmake() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/3.5/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/geos) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/geos/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libgeos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libgeos.lib) + vcpkg_copy_pdbs() +else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/geos_c.lib ${CURRENT_PACKAGES_DIR}/debug/lib/geos_c.lib) + +endif() \ No newline at end of file