diff options
| author | Manuel Massing <Manuel Massing m.massing@warped-space.de> | 2016-11-23 19:28:16 +0100 |
|---|---|---|
| committer | Manuel Massing <m.massing@warped-space.de> | 2016-11-25 17:26:39 +0100 |
| commit | 3cff7cd6af89c8d75dde0b2005a79405f386e807 (patch) | |
| tree | 9ffdc3d4a199b76114bb7f5950b5f7ceb06e4d59 | |
| parent | 2a8d61bf1bb74182f9a213ce4e640b05675f01df (diff) | |
| download | vcpkg-3cff7cd6af89c8d75dde0b2005a79405f386e807.tar.gz vcpkg-3cff7cd6af89c8d75dde0b2005a79405f386e807.zip | |
Add PROJ.4 cartographic projection library port
5 files changed, 232 insertions, 0 deletions
diff --git a/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch b/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch new file mode 100644 index 000000000..9be5438aa --- /dev/null +++ b/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch @@ -0,0 +1,26 @@ +From ca8bb14234091ab7b1ada2b9e5abb04f40d459cb Mon Sep 17 00:00:00 2001 +From: Manuel Massing <Manuel Massing m.massing@warped-space.de> +Date: Tue, 22 Nov 2016 12:00:39 +0100 +Subject: [PATCH 1/3] CMake: add detection of recent visual studio versions + +--- + cmake/Proj4SystemInfo.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/Proj4SystemInfo.cmake b/cmake/Proj4SystemInfo.cmake +index 294a50b..c7fb6bf 100644 +--- a/cmake/Proj4SystemInfo.cmake ++++ b/cmake/Proj4SystemInfo.cmake +@@ -50,6 +50,9 @@ if(WIN32) + if(MSVC_VERSION EQUAL 1800) + set(PROJ_COMPILER_NAME "msvc-12.0") #Visual Studio 2013 + endif() ++ if(MSVC_VERSION EQUAL 1900) ++ set(PROJ_COMPILER_NAME "msvc-14.0") #Visual Studio 2015 ++ endif() + endif(MSVC) + + if(MINGW) +-- +2.9.2.windows.1 + diff --git a/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch b/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch new file mode 100644 index 000000000..2c470570e --- /dev/null +++ b/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch @@ -0,0 +1,52 @@ +From 1265d13f29259be05535241e9bcbfcf16857dc06 Mon Sep 17 00:00:00 2001 +From: Manuel Massing <Manuel Massing m.massing@warped-space.de> +Date: Tue, 22 Nov 2016 12:04:10 +0100 +Subject: [PATCH 2/3] CMake: fix error by only setting properties for targets + which are actually defined + +--- + src/CMakeLists.txt | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8d7e7d1..59ad00a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -22,25 +22,30 @@ if(NOT MSVC) + endif () + endif () + ++ + if(BUILD_CS2CS) +- include(bin_cs2cs.cmake) ++ list(APPEND BINARY_TARGETS cs2cs) ++ include(bin_cs2cs.cmake) + endif(BUILD_CS2CS) + + if(BUILD_PROJ) ++ list(APPEND BINARY_TARGETS proj) + include(bin_proj.cmake) + endif(BUILD_PROJ) + + if(BUILD_GEOD) ++ list(APPEND BINARY_TARGETS geod) + include(bin_geod.cmake) + include(bin_geodtest.cmake) + endif(BUILD_GEOD) + + if(BUILD_NAD2BIN) ++ list(APPEND BINARY_TARGETS nad2bin) + include(bin_nad2bin.cmake) + endif(BUILD_NAD2BIN) + +-if (MSVC OR CMAKE_CONFIGURATION_TYPES) ++if ((MSVC OR CMAKE_CONFIGURATION_TYPES) AND BINARY_TARGETS) + # Add _d suffix for your debug versions of the tools +- set_target_properties (cs2cs binproj geod nad2bin PROPERTIES +- DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++ set_target_properties(${BINARY_TARGETS} PROPERTIES ++ DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) + endif () +-- +2.9.2.windows.1 + diff --git a/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch b/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch new file mode 100644 index 000000000..5870e12ea --- /dev/null +++ b/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch @@ -0,0 +1,98 @@ +From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 +From: Manuel Massing <Manuel Massing m.massing@warped-space.de> +Date: Tue, 22 Nov 2016 12:26:39 +0100 +Subject: [PATCH 3/3] CMake: configurable cmake config install location + +--- + CMakeLists.txt | 1 + + cmake/CMakeLists.txt | 14 +++++++------- + cmake/Proj4InstallPath.cmake | 12 +++++++++--- + 3 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cde21f0..1b1f892 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,6 +106,7 @@ set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries in + set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.") + set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.") + set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.") ++set(CMAKEDIR "${DEFAULT_CMAKE_CONFIGDIR}" CACHE PATH "The directory to install cmake files into.") + + ################################################################################# + # Build configured components +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 742da0e..2bdef0d 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -2,13 +2,13 @@ + # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative + # path to the root from there. (Note that the whole install tree can + # be relocated.) +-if (NOT WIN32) +- set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") +- set (PROJECT_ROOT_DIR "../../..") +-else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") +-endif () ++ ++set (INSTALL_CMAKE_DIR ${CMAKEDIR}) ++if(NOT IS_ABSOLUTE ${INSTALL_CMAKE_DIR}) ++ set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKEDIR}") ++endif() ++ ++file(RELATIVE_PATH PROJECT_ROOT_DIR ${INSTALL_CMAKE_DIR} ${CMAKE_INSTALL_PREFIX}) + + string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) + configure_file (project-config.cmake.in project-config.cmake @ONLY) +diff --git a/cmake/Proj4InstallPath.cmake b/cmake/Proj4InstallPath.cmake +index da1491c..826fb29 100644 +--- a/cmake/Proj4InstallPath.cmake ++++ b/cmake/Proj4InstallPath.cmake +@@ -28,13 +28,15 @@ if(WIN32) + set(DEFAULT_DATA_SUBDIR share) + set(DEFAULT_INCLUDE_SUBDIR local/include) + set(DEFAULT_DOC_SUBDIR share/doc/proj) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "cmake") + else() +- # Common locatoins for Unix and Mac OS X ++ # Common locations for Unix and Mac OS X + set(DEFAULT_BIN_SUBDIR bin) + set(DEFAULT_LIB_SUBDIR lib) + set(DEFAULT_DATA_SUBDIR share/proj) + set(DEFAULT_DOC_SUBDIR doc/proj) + set(DEFAULT_INCLUDE_SUBDIR include) ++ set(DEFAULT_CMAKE_CONFIG_SUBDIR "share/cmake/${PROJECT_NAME}") + endif() + + # Locations are changeable by user to customize layout of PDAL installation +@@ -49,19 +51,23 @@ set(PROJ_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") + set(PROJ_DOC_SUBDIR ${DEFAULT_DOC_SUBDIR} CACHE STRING + "Subdirectory where data will be installed") +- ++set(PROJ_CMAKE_CONFIG_SUBDIR ${DEFAULT_CMAKE_CONFIG_SUBDIR} CACHE STRING ++ "Subdirectory where cmake configuration files will be installed") ++ + # Mark *DIR variables as advanced and dedicated to use by power-users only. + mark_as_advanced(PROJ_ROOT_DIR + PROJ_BIN_SUBDIR + PROJ_LIB_SUBDIR + PROJ_INCLUDE_SUBDIR + PROJ_DATA_SUBDIR +- PROJ_DOC_SUBDIR ) ++ PROJ_DOC_SUBDIR ++ PROJ_CMAKE_CONFIG_SUBDIR) + + set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}") + set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}") + set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}") + set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}") + set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}") ++set(DEFAULT_CMAKE_CONFIGDIR "${PROJ_CMAKE_CONFIG_SUBDIR}") + + +-- +2.9.2.windows.1 + diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL new file mode 100644 index 000000000..f31a03049 --- /dev/null +++ b/ports/proj4/CONTROL @@ -0,0 +1,3 @@ +Source: proj4 +Version: 4.9.3 +Description: PROJ.4 library for cartographic projections diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake new file mode 100644 index 000000000..e5af388b0 --- /dev/null +++ b/ports/proj4/portfile.cmake @@ -0,0 +1,53 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/proj-4.9.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://download.osgeo.org/proj/proj-4.9.3.zip" + FILENAME "proj-4.9.3.zip" + SHA512 c9703008cd1f75fe1239b180158e560b9b88ae2ffd900b72923c716908eb86d1abbc4230647af5e3131f8c34481bdc66b03826d669620161ffcfbe67801cb631 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH}/ + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-CMake-add-detection-of-recent-visual-studio-versions.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-CMake-configurable-cmake-config-install-location.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=YES") +else() + list(APPEND CMAKE_OPTIONS "-DBUILD_LIBPROJ_SHARED=NO") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${CMAKE_OPTIONS} + -DPROJ_LIB_SUBDIR=lib + -DPROJ_INCLUDE_SUBDIR=include + -DPROJ_DATA_SUBDIR=share/proj4 + -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +vcpkg_install_cmake( + -DBUILD_CS2CS=NO + -DBUILD_PROJ=NO + -DBUILD_GEOD=NO + -DBUILD_NAD2BIN=NO + -DPROJ4_TESTS=NO +) + +# Remove duplicate headers installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# Remove data installed from debug build +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/proj4) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/proj4/COPYING ${CURRENT_PACKAGES_DIR}/share/proj4/copyright) |
