2019-10-18 08:15:52 +08:00
|
|
|
vcpkg_from_github(
|
2019-05-29 07:58:00 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2019-10-18 08:15:52 +08:00
|
|
|
REPO OSGeo/PROJ
|
2022-01-04 05:56:02 +08:00
|
|
|
REF 8.2.1
|
|
|
|
SHA512 8af4c41320e3fd60af3bfa89a89fd1bb22461786a4288a5873d82f90c51eaef021f539b6a6bcc8e393f786a84ea3747a75d80d95e620f20ef2a353f1a90b74bc
|
2019-10-18 08:15:52 +08:00
|
|
|
HEAD_REF master
|
2017-10-03 06:54:35 +08:00
|
|
|
PATCHES
|
2019-10-18 08:15:52 +08:00
|
|
|
fix-win-output-name.patch
|
2020-12-02 05:59:39 +08:00
|
|
|
fix-proj4-targets-cmake.patch
|
2020-11-26 03:26:09 +08:00
|
|
|
tools-cmake.patch
|
2021-12-10 10:18:18 +08:00
|
|
|
pkgconfig.patch
|
2017-10-03 06:54:35 +08:00
|
|
|
)
|
|
|
|
|
2019-10-18 08:15:52 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-08-10 08:30:02 +08:00
|
|
|
FEATURES
|
2021-12-10 10:18:18 +08:00
|
|
|
net ENABLE_CURL
|
|
|
|
tiff ENABLE_TIFF
|
2022-01-04 05:56:02 +08:00
|
|
|
tools BUILD_APPS
|
2019-10-18 08:15:52 +08:00
|
|
|
)
|
2020-12-02 05:59:39 +08:00
|
|
|
|
2022-01-04 05:56:02 +08:00
|
|
|
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)
|
|
|
|
set(BUILD_PROJSYNC OFF)
|
|
|
|
vcpkg_list(APPEND FEATURE_OPTIONS -DBUILD_PROJSYNC=${BUILD_PROJSYNC})
|
|
|
|
vcpkg_list(REMOVE_ITEM TOOL_NAMES projsync)
|
2020-12-02 05:59:39 +08:00
|
|
|
endif()
|
|
|
|
|
2021-12-10 10:18:18 +08:00
|
|
|
find_program(EXE_SQLITE3 NAMES "sqlite3" PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools" NO_DEFAULT_PATH REQUIRED)
|
2019-10-18 08:15:52 +08:00
|
|
|
|
2021-08-10 08:30:02 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-12-10 10:18:18 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-01-04 05:56:02 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DNLOHMANN_JSON=external
|
|
|
|
-DPROJ_LIB_SUBDIR=lib
|
|
|
|
-DPROJ_INCLUDE_SUBDIR=include
|
|
|
|
-DPROJ_DATA_SUBDIR=share/${PORT}
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
"-DEXE_SQLITE3=${EXE_SQLITE3}"
|
2017-10-03 06:54:35 +08:00
|
|
|
)
|
|
|
|
|
2021-08-10 08:30:02 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
2022-01-04 05:56:02 +08:00
|
|
|
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()
|
|
|
|
|
2021-08-10 08:30:02 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME PROJ CONFIG_PATH lib/cmake/proj DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME PROJ4 CONFIG_PATH lib/cmake/proj4)
|
|
|
|
|
2020-11-26 03:26:09 +08:00
|
|
|
if ("tools" IN_LIST FEATURES)
|
2020-12-02 05:59:39 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
|
2020-11-26 03:26:09 +08:00
|
|
|
endif ()
|
2017-10-03 06:54:35 +08:00
|
|
|
|
2021-08-10 08:30:02 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-10-03 06:54:35 +08:00
|
|
|
|
2021-03-11 01:56:45 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-08-14 04:41:32 +08:00
|
|
|
|
2021-10-22 13:44:17 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-12-10 10:18:18 +08:00
|
|
|
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()
|
2021-10-22 13:44:17 +08:00
|
|
|
|
2021-08-14 04:41:32 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|