diff options
Diffstat (limited to 'vcpkg/ports/proj')
| -rw-r--r-- | vcpkg/ports/proj/fix-proj4-targets-cmake.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/proj/portfile.cmake | 72 | ||||
| -rw-r--r-- | vcpkg/ports/proj/remove_toolset_restriction.patch | 19 | ||||
| -rw-r--r-- | vcpkg/ports/proj/sqlite.diff | 32 | ||||
| -rw-r--r-- | vcpkg/ports/proj/usage | 9 | ||||
| -rw-r--r-- | vcpkg/ports/proj/vcpkg.json | 58 |
6 files changed, 202 insertions, 0 deletions
diff --git a/vcpkg/ports/proj/fix-proj4-targets-cmake.patch b/vcpkg/ports/proj/fix-proj4-targets-cmake.patch new file mode 100644 index 0000000..30c2242 --- /dev/null +++ b/vcpkg/ports/proj/fix-proj4-targets-cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d736d129..2be8f8be9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -151,6 +165,7 @@ if(ENABLE_TIFF) + find_package(TIFF REQUIRED) + if(TIFF_FOUND) + set(TIFF_ENABLED TRUE) ++ set(TIFF_LIBRARY TIFF::TIFF) + else() + message(SEND_ERROR + "libtiff dependency not found! Use ENABLE_TIFF=OFF to force it off") diff --git a/vcpkg/ports/proj/portfile.cmake b/vcpkg/ports/proj/portfile.cmake new file mode 100644 index 0000000..6aeb568 --- /dev/null +++ b/vcpkg/ports/proj/portfile.cmake @@ -0,0 +1,72 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO OSGeo/PROJ + REF "${VERSION}" + SHA512 0899fbf37e9a51abd9a4ded90b5fc0500432b497e27e05b21c524935621098399120cf3151e8ee4637b79943bd7ee31cda75f064a7f9ef47de5199d96ca92aa4 + HEAD_REF master + PATCHES + fix-proj4-targets-cmake.patch + remove_toolset_restriction.patch + sqlite.diff +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + net ENABLE_CURL + tiff ENABLE_TIFF + tools BUILD_APPS +) + +vcpkg_list(SET TOOL_NAMES cct cs2cs geod gie invgeod invproj proj projinfo projsync) +if("tools" IN_LIST FEATURES AND NOT "net" IN_LIST FEATURES) + vcpkg_list(APPEND FEATURE_OPTIONS -DBUILD_PROJSYNC=OFF) + vcpkg_list(REMOVE_ITEM TOOL_NAMES projsync) +endif() + +find_program(EXE_SQLITE3 NAMES "sqlite3" PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools" NO_DEFAULT_PATH REQUIRED) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DNLOHMANN_JSON=external + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF + "-DEXE_SQLITE3=${EXE_SQLITE3}" + -DPROJ_DATA_ENV_VAR_TRIED_LAST=ON + -DEMBED_PROJ_DATA_PATH=OFF + OPTIONS_DEBUG + -DBUILD_APPS=OFF +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(PACKAGE_NAME proj4 CONFIG_PATH lib/cmake/proj4 DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/proj) +vcpkg_fixup_pkgconfig() + +if(NOT DEFINED VCPKG_BUILD_TYPE AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/proj.pc" " -lproj" " -lproj_d") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Enforce consistency with src/lib_proj.cmake build time configuration. + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/proj.h" + "#ifndef PROJ_DLL" + "#ifndef PROJ_DLL\n# define PROJ_DLL\n#elif 0" + ) +endif() + +if ("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif () + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/doc" + "${CURRENT_PACKAGES_DIR}/share/man" +) + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/proj/remove_toolset_restriction.patch b/vcpkg/ports/proj/remove_toolset_restriction.patch new file mode 100644 index 0000000..7da2737 --- /dev/null +++ b/vcpkg/ports/proj/remove_toolset_restriction.patch @@ -0,0 +1,19 @@ +diff --git a/cmake/project-config-version.cmake.in b/cmake/project-config-version.cmake.in +index d9807b2c5..7ffe39364 100644 +--- a/cmake/project-config-version.cmake.in ++++ b/cmake/project-config-version.cmake.in +@@ -28,14 +28,6 @@ elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR + # since a multi-architecture library is built for that platform). + set (REASON "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@") + set (PACKAGE_VERSION_UNSUITABLE TRUE) +-elseif (MSVC AND NOT ( +- # toolset version must be at least as great as @PROJECT_NAME@'s +- MSVC_TOOLSET_VERSION GREATER_EQUAL @MSVC_TOOLSET_VERSION@ +- # and major versions must match +- AND MSVC_TOOLSET_MAJOR EQUAL @MSVC_TOOLSET_MAJOR@ )) +- # Reject if there's a mismatch in MSVC compiler versions +- set (REASON "MSVC_TOOLSET_VERSION = @MSVC_TOOLSET_VERSION@") +- set (PACKAGE_VERSION_UNSUITABLE TRUE) + elseif (PACKAGE_FIND_VERSION) + if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set (PACKAGE_VERSION_EXACT TRUE) diff --git a/vcpkg/ports/proj/sqlite.diff b/vcpkg/ports/proj/sqlite.diff new file mode 100644 index 0000000..14e9a61 --- /dev/null +++ b/vcpkg/ports/proj/sqlite.diff @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5c9de0f..d43fe91 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -214,12 +214,12 @@ if(DEFINED SQLITE3_LIBRARY) + set(SQLite3_LIBRARY ${SQLITE3_LIBRARY}) + endif() + +-find_package(SQLite3 REQUIRED) ++find_package(unofficial-sqlite3 CONFIG REQUIRED) ++add_library(SQLite::SQLite3 ALIAS unofficial::sqlite3::sqlite3) + + # Would build and run with older versions, but with horrible performance + # See https://github.com/OSGeo/PROJ/issues/1718 + if(SQLite3_VERSION VERSION_LESS "3.11") +- message(SEND_ERROR "SQLite3 >= 3.11 required!") + endif() + + ################################################################################ +diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in +index 0ca48aa..ab4e931 100644 +--- a/cmake/project-config.cmake.in ++++ b/cmake/project-config.cmake.in +@@ -27,7 +27,7 @@ if("@CURL_ENABLED@") + endif() + cmake_policy(POP) + +-find_dependency(SQLite3) ++find_dependency(unofficial-sqlite3) + + if(DEFINED PROJ_CONFIG_FIND_TIFF_DEP) + find_dependency(TIFF) diff --git a/vcpkg/ports/proj/usage b/vcpkg/ports/proj/usage new file mode 100644 index 0000000..06eb04d --- /dev/null +++ b/vcpkg/ports/proj/usage @@ -0,0 +1,9 @@ +proj provides CMake targets: + + find_package(PROJ CONFIG REQUIRED) + target_link_libraries(main PRIVATE PROJ::proj) + +proj provides pkg-config modules: + + # Coordinate transformation software library + proj diff --git a/vcpkg/ports/proj/vcpkg.json b/vcpkg/ports/proj/vcpkg.json new file mode 100644 index 0000000..fc77074 --- /dev/null +++ b/vcpkg/ports/proj/vcpkg.json @@ -0,0 +1,58 @@ +{ + "name": "proj", + "version": "9.7.0", + "description": "PROJ library for cartographic projections", + "homepage": "https://proj.org/", + "license": "MIT", + "dependencies": [ + "nlohmann-json", + { + "name": "sqlite3", + "default-features": false + }, + { + "name": "sqlite3", + "host": true, + "default-features": false, + "features": [ + "tool" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "net", + "tiff" + ], + "features": { + "net": { + "description": "Enable network support", + "dependencies": [ + "curl" + ] + }, + "tiff": { + "description": "Enable TIFF support to read some grids", + "dependencies": [ + { + "name": "tiff", + "default-features": false, + "features": [ + "lzma", + "zip" + ] + } + ] + }, + "tools": { + "description": "Build tools" + } + } +} |