From 3cff7cd6af89c8d75dde0b2005a79405f386e807 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Wed, 23 Nov 2016 19:28:16 +0100 Subject: Add PROJ.4 cartographic projection library port --- ...etection-of-recent-visual-studio-versions.patch | 26 ++++++ ...rror-by-only-setting-properties-for-targe.patch | 52 ++++++++++++ ...onfigurable-cmake-config-install-location.patch | 98 ++++++++++++++++++++++ ports/proj4/CONTROL | 3 + ports/proj4/portfile.cmake | 53 ++++++++++++ 5 files changed, 232 insertions(+) create mode 100644 ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch create mode 100644 ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch create mode 100644 ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch create mode 100644 ports/proj4/CONTROL create mode 100644 ports/proj4/portfile.cmake 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 +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 +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 +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) -- cgit v1.2.3 From 16a3384f9a3784c3275977880d0daf73ece44243 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Sat, 26 Nov 2016 09:35:21 +0100 Subject: [proj4] Replace tabs with spaces --- ports/proj4/portfile.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index e5af388b0..d38a1b4ab 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -9,10 +9,10 @@ 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 + 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) @@ -26,13 +26,13 @@ vcpkg_configure_cmake( OPTIONS ${CMAKE_OPTIONS} -DPROJ_LIB_SUBDIR=lib -DPROJ_INCLUDE_SUBDIR=include - -DPROJ_DATA_SUBDIR=share/proj4 - -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj4 + -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 + -DPROJ4_TESTS=NO ) vcpkg_install_cmake( @@ -40,7 +40,7 @@ vcpkg_install_cmake( -DBUILD_PROJ=NO -DBUILD_GEOD=NO -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO + -DPROJ4_TESTS=NO ) # Remove duplicate headers installed from debug build -- cgit v1.2.3 From 524f716570aad90e3f7c3094af3eec8e548dec71 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:57:19 +0100 Subject: [proj4] Rename port from "proj4" to "proj" --- ...etection-of-recent-visual-studio-versions.patch | 26 ++++++ ...rror-by-only-setting-properties-for-targe.patch | 52 ++++++++++++ ...onfigurable-cmake-config-install-location.patch | 98 ++++++++++++++++++++++ ports/proj/CONTROL | 3 + ports/proj/portfile.cmake | 53 ++++++++++++ ...etection-of-recent-visual-studio-versions.patch | 26 ------ ...rror-by-only-setting-properties-for-targe.patch | 52 ------------ ...onfigurable-cmake-config-install-location.patch | 98 ---------------------- ports/proj4/CONTROL | 3 - ports/proj4/portfile.cmake | 53 ------------ 10 files changed, 232 insertions(+), 232 deletions(-) create mode 100644 ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch create mode 100644 ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch create mode 100644 ports/proj/0003-CMake-configurable-cmake-config-install-location.patch create mode 100644 ports/proj/CONTROL create mode 100644 ports/proj/portfile.cmake delete mode 100644 ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch delete mode 100644 ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch delete mode 100644 ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch delete mode 100644 ports/proj4/CONTROL delete mode 100644 ports/proj4/portfile.cmake diff --git a/ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch b/ports/proj/0001-CMake-add-detection-of-recent-visual-studio-versions.patch new file mode 100644 index 000000000..9be5438aa --- /dev/null +++ b/ports/proj/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 +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/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch b/ports/proj/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch new file mode 100644 index 000000000..2c470570e --- /dev/null +++ b/ports/proj/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 +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/proj/0003-CMake-configurable-cmake-config-install-location.patch b/ports/proj/0003-CMake-configurable-cmake-config-install-location.patch new file mode 100644 index 000000000..5870e12ea --- /dev/null +++ b/ports/proj/0003-CMake-configurable-cmake-config-install-location.patch @@ -0,0 +1,98 @@ +From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 +From: Manuel Massing +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/proj/CONTROL b/ports/proj/CONTROL new file mode 100644 index 000000000..b706ca11a --- /dev/null +++ b/ports/proj/CONTROL @@ -0,0 +1,3 @@ +Source: proj +Version: 4.9.3 +Description: PROJ.4 library for cartographic projections diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake new file mode 100644 index 000000000..c67edb70c --- /dev/null +++ b/ports/proj/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/proj + -DPROJ_CMAKE_CONFIG_SUBDIR=share/proj + -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/proj) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/proj/COPYING ${CURRENT_PACKAGES_DIR}/share/proj/copyright) 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 deleted file mode 100644 index 9be5438aa..000000000 --- a/ports/proj4/0001-CMake-add-detection-of-recent-visual-studio-versions.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ca8bb14234091ab7b1ada2b9e5abb04f40d459cb Mon Sep 17 00:00:00 2001 -From: Manuel Massing -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 deleted file mode 100644 index 2c470570e..000000000 --- a/ports/proj4/0002-CMake-fix-error-by-only-setting-properties-for-targe.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1265d13f29259be05535241e9bcbfcf16857dc06 Mon Sep 17 00:00:00 2001 -From: Manuel Massing -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 deleted file mode 100644 index 5870e12ea..000000000 --- a/ports/proj4/0003-CMake-configurable-cmake-config-install-location.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 0be627798d943558c674d4d92767ca255d847631 Mon Sep 17 00:00:00 2001 -From: Manuel Massing -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 deleted file mode 100644 index f31a03049..000000000 --- a/ports/proj4/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index d38a1b4ab..000000000 --- a/ports/proj4/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -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) -- cgit v1.2.3 From c969fad3f99c5c6b0ef50d7f30a66d0a12c59d2c Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:59:41 +0100 Subject: [proj] Rename library to "proj.lib" / "projd.lib" --- ports/proj/portfile.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake index c67edb70c..88941291c 100644 --- a/ports/proj/portfile.cmake +++ b/ports/proj/portfile.cmake @@ -43,6 +43,15 @@ vcpkg_install_cmake( -DPROJ4_TESTS=NO ) +# Rename library and adapt cmake configuration +# N.B. debug cmake export is not copied, as it's not relocatable +file(READ ${CURRENT_PACKAGES_DIR}/share/proj/proj4-targets-release.cmake PROJ4_TARGETS_RELEASE) +string(REPLACE "proj_4_9.lib" "proj.lib" PROJ4_TARGETS_RELEASE ${PROJ4_TARGETS_RELEASE}) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj/proj4-targets-release.cmake ${PROJ4_TARGETS_RELEASE}) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/proj_4_9.lib ${CURRENT_PACKAGES_DIR}/lib/proj.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/proj_4_9_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/projd.lib) + # Remove duplicate headers installed from debug build file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Remove data installed from debug build -- cgit v1.2.3 From de3189dbe6c5107495bf65b066712b54d4ff9e51 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 28 Nov 2016 14:59:59 +0100 Subject: [proj] Remove unused parameters --- ports/proj/portfile.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/proj/portfile.cmake b/ports/proj/portfile.cmake index 88941291c..6007ab62a 100644 --- a/ports/proj/portfile.cmake +++ b/ports/proj/portfile.cmake @@ -35,13 +35,8 @@ vcpkg_configure_cmake( -DPROJ4_TESTS=NO ) -vcpkg_install_cmake( - -DBUILD_CS2CS=NO - -DBUILD_PROJ=NO - -DBUILD_GEOD=NO - -DBUILD_NAD2BIN=NO - -DPROJ4_TESTS=NO -) +vcpkg_install_cmake() + # Rename library and adapt cmake configuration # N.B. debug cmake export is not copied, as it's not relocatable -- cgit v1.2.3