[Proj4] Update to 7.2.0 (#14800)

* update proj4 to 7.2.0

* fix cmake find

* add tiff,curl feature

* fix depends

* Update fix-proj4-targets-cmake.patch

* fix

* remove tiff and curl when static build

* fix windows static build error

* Update ports/proj4/portfile.cmake

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>

* change port version

* use find_dependency instead of find_package

* Update fix-proj4-targets-cmake.patch

* Update fix-proj4-targets-cmake.patch

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
Long Huan 2020-12-02 05:59:39 +08:00 committed by GitHub
parent 5d813f3880
commit 629acdf9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 81 additions and 121 deletions

View File

@ -1,6 +1,6 @@
Source: libspatialite
Version: 4.3.0a
Port-Version: 6
Port-Version: 7
Homepage: https://www.gaia-gis.it/gaia-sins/libspatialite-sources
Description: SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities.
Build-Depends: libxml2, sqlite3, geos, proj4, zlib, freexl, libiconv

View File

@ -44,7 +44,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib \
${LIBXML2_LIBS_DBG} \
${GEOS_LIBS_DBG} \
${CURRENT_INSTALLED_DIR}/debug/lib/proj_d.lib"
${CURRENT_INSTALLED_DIR}/debug/lib/proj_d.lib ole32.lib shell32.lib"
)
set(LIBS_ALL_REL
"${CURRENT_INSTALLED_DIR}/lib/iconv.lib \
@ -54,7 +54,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
${CURRENT_INSTALLED_DIR}/lib/zlib.lib \
${LIBXML2_LIBS_REL} \
${GEOS_LIBS_REL} \
${CURRENT_INSTALLED_DIR}/lib/proj.lib"
${CURRENT_INSTALLED_DIR}/lib/proj.lib ole32.lib shell32.lib"
)
################

View File

@ -1,15 +1,18 @@
Source: proj4
Version: 6.3.1
Port-Version: 3
Version: 7.2.0
Homepage: https://github.com/OSGeo/PROJ
Description: PROJ.4 library for cartographic projections
Build-Depends: sqlite3[core]
Default-Features: database
Default-Features: database,tiff
Feature: tiff
Build-Depends: tiff
Description: Enable TIFF support to read some grids
Feature: database
Build-Depends: sqlite3[tool] (!uwp&!arm)
Description: generate database
Feature: tools
Build-Depends:
Build-Depends: curl
Description: generate tools

View File

@ -1,28 +0,0 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 61c69f7..777b5d8 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -28,7 +28,3 @@ install(FILES
install(EXPORT targets
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
-install(EXPORT targets
- NAMESPACE ${PROJECT_NAME}::
- FILE ${PROJECT_NAME_LOWER}-namespace-targets.cmake
- DESTINATION "${CMAKECONFIGDIR}")
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index c62ecb4..9a52b3b 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -20,10 +20,9 @@ set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/@INCLUDEDIR@")
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/@LIBDIR@")
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/@BINDIR@")
-set (@PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::proj)
+set (@PROJECT_NAME@_LIBRARIES proj)
# Read in the exported definition of the library
include ("${_DIR}/@PROJECT_NAME_LOWER@-targets.cmake")
-include ("${_DIR}/@PROJECT_NAME_LOWER@-namespace-targets.cmake")
unset (_ROOT)
unset (_DIR)

View File

@ -1,11 +1,11 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9213990..f51cc5e 100644
index 7d736d129..93d7801dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,7 +224,9 @@ set(CMAKECONFIGDIR "${DEFAULT_CMAKEDIR}"
include_directories(${PROJ4_SOURCE_DIR}/src)
@@ -269,7 +269,9 @@ endif()
################################################################################
include_directories(${PROJ_SOURCE_DIR}/src)
message(STATUS "")
-add_subdirectory(data)
+if(BUILD_PROJ_DATABASE)
+ add_subdirectory(data)

View File

@ -1,18 +0,0 @@
diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake
index cf7533b..236581f 100644
--- a/src/lib_proj.cmake
+++ b/src/lib_proj.cmake
@@ -431,11 +431,11 @@ set(PROJ_LIBRARIES ${PROJ_LIBRARIES} PARENT_SCOPE)
if(UNIX)
find_library(M_LIB m)
if(M_LIB)
- target_link_libraries(${PROJ_CORE_TARGET} -lm)
+ target_link_libraries(${PROJ_CORE_TARGET} PRIVATE -lm)
endif()
endif()
if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
- target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(${PROJ_CORE_TARGET} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
endif()
include_directories(${SQLITE3_INCLUDE_DIR})

View File

@ -1,13 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c617912..bed0428 100644
index 7d736d129..2be8f8be9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,23 @@ if(NOT EXE_SQLITE3)
@@ -129,7 +129,22 @@ if(NOT EXE_SQLITE3)
message(SEND_ERROR "sqlite3 binary not found!")
endif()
-find_package(Sqlite3 REQUIRED)
+#find_package(Sqlite3 REQUIRED)
+find_package(unofficial-sqlite3 CONFIG REQUIRED)
+if(unofficial-sqlite3_FOUND)
+ set(SQLITE3_FOUND true)
@ -27,31 +26,43 @@ index c617912..bed0428 100644
if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
@@ -171,6 +186,7 @@ if(ENABLE_CURL)
find_package(CURL REQUIRED)
if(CURL_FOUND)
set(CURL_ENABLED TRUE)
+ set(CURL_LIBRARY CURL::libcurl)
else()
message(SEND_ERROR "curl dependency not found!")
endif()
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 92197c8..ab65de7 100644
index c790fa4a8..6653a28b9 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -25,6 +25,10 @@ else ()
endif ()
@@ -95,6 +95,10 @@ endif ()
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
+set(FIND_DEPENDENCY_SQLITE3 "")
+if(NOT BUILD_LIBPROJ_SHARED)
+ set(FIND_DEPENDENCY_SQLITE3 "find_package(unofficial-sqlite3 CONFIG REQUIRED)")
+endif()
configure_file(project-config.cmake.in project-config.cmake @ONLY)
configure_file(project-config-version.cmake.in
project-config-version.cmake @ONLY)
foreach (PROJECT_VARIANT_NAME ${PROJECT_NAME} ${PROJECT_LEGACY_NAME})
string (TOLOWER "${PROJECT_VARIANT_NAME}" PROJECT_VARIANT_LOWER)
+ set(FIND_DEPENDENCY_SQLITE3 "find_dependency(unofficial-sqlite3 CONFIG)")
+ if(CURL_ENABLED)
+ set(FIND_DEPENDENCY_CURL "find_dependency(CURL CONFIG)")
+ endif()
set (CMAKECONFIGSUBDIR "${CMAKECONFIGDIR}/${PROJECT_VARIANT_LOWER}")
# proj-config.cmake for the install tree. It's installed in
# ${CMAKECONFIGSUBDIR} and @PROJECT_ROOT_DIR@ is the relative
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index 9a52b3b..295d95d 100644
index 23f997abd..8baef00f0 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -13,6 +13,8 @@ message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
message (STATUS
"@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}")
+@FIND_DEPENDENCY_SQLITE3@
@@ -7,6 +7,10 @@
# @PROJECT_VARIANT_NAME@_LIBRARY_DIRS = /usr/local/lib
# @PROJECT_VARIANT_NAME@_BINARY_DIRS = /usr/local/bin
# @PROJECT_VARIANT_NAME@_VERSION = 4.9.1 (for example)
+include(CMakeFindDependencyMacro)
+
+@FIND_DEPENDENCY_SQLITE3@
+@FIND_DEPENDENCY_CURL@
# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)

View File

@ -1,13 +0,0 @@
diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake
index 2e90f98f..dc171e91 100644
--- a/src/lib_proj.cmake
+++ b/src/lib_proj.cmake
@@ -441,7 +441,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
endif()
include_directories(${SQLITE3_INCLUDE_DIR})
-target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY})
+target_link_libraries(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_LIBRARY})
if(MSVC AND BUILD_LIBPROJ_SHARED)
target_compile_definitions(${PROJ_CORE_TARGET}

View File

@ -1,13 +1,13 @@
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index 1a2b605..cf62f02 100644
index 6f43edb5c..1ed89d597 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -104,7 +104,7 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
@@ -51,7 +51,7 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
# On Windows, ABI version is specified using binary file name suffix.
# On Unix, suffix is empty and SOVERSION is used instead.
- if(WIN32)
+ if(0)
string(LENGTH "${${PROJECT_INTERN_NAME}_ABI_VERSION}" abilen)
string(LENGTH "${${PROJECT_NAME}_ABI_VERSION}" abilen)
if(abilen GREATER 0)
set(SUFFIX "_${${PROJECT_INTERN_NAME}_ABI_VERSION}")
set(SUFFIX "_${${PROJECT_NAME}_ABI_VERSION}")

View File

@ -1,35 +1,42 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OSGeo/PROJ
REF 6.3.1
SHA512 ec5a2b61b12d3d3ec2456b9e742cf7be98767889c4759334e60276f609054fa8eb59f13f07af38e69e9ee7b6f2b9542e2d5d7806726ce5616062af4de626c6fa
REF 7.2.0
SHA512 65dfca92b7890a9ffa78f48da443045069a250e2974dcf564fa23ffc297f87235b669983b39906352bd8eb702714b98fd89a4c7beaad4ad70834993a6de85128
HEAD_REF master
PATCHES
fix-sqlite3-bin.patch
disable-export-namespace.patch
disable-projdb-with-arm-uwp.patch
fix-win-output-name.patch
fix-sqlite-dependency-export.patch
fix-linux-build.patch
use-sqlite3-config.patch
fix-proj4-targets-cmake.patch
tools-cmake.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(VCPKG_BUILD_SHARED_LIBS ON)
set(EXTRA_FEATURES tiff ENABLE_TIFF tools BUILD_PROJSYNC tools ENABLE_CURL)
set(TOOL_NAMES cct cs2cs geod gie proj projinfo projsync)
else()
set(VCPKG_BUILD_SHARED_LIBS OFF)
set(TOOL_NAMES cct cs2cs geod gie proj projinfo)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
database BUILD_PROJ_DATABASE
tools BUILD_CCT
tools BUILD_CS2CS
tools BUILD_GEOD
tools BUILD_GIE
tools BUILD_PROJ
tools BUILD_PROJINFO
database BUILD_PROJ_DATABASE
tools BUILD_CCT
tools BUILD_CS2CS
tools BUILD_GEOD
tools BUILD_GIE
tools BUILD_PROJ
tools BUILD_PROJINFO
${EXTRA_FEATURES}
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(WARNING "ENABLE_TIFF ENABLE_CURL and BUILD_PROJSYNC will be off when building static")
set(FEATURE_OPTIONS ${FEATURE_OPTIONS} -DENABLE_TIFF=OFF -DENABLE_CURL=OFF -DBUILD_PROJSYNC=OFF)
endif()
if ("database" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_WINDOWS)
set(BIN_SUFFIX .exe)
@ -56,18 +63,17 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
-DBUILD_LIBPROJ_SHARED=${VCPKG_BUILD_SHARED_LIBS}
-DPROJ_LIB_SUBDIR=lib
-DPROJ_INCLUDE_SUBDIR=include
-DPROJ_DATA_SUBDIR=share/proj4
-DPROJ_TESTS=OFF
-DPROJ_DATA_SUBDIR=share/${PORT}
-DBUILD_TESTING=OFF
-DEXE_SQLITE3=${SQLITE3_BIN_PATH}/sqlite3${BIN_SUFFIX}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/proj4)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
if ("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES cct cs2cs geod gie proj projinfo AUTO_CLEAN)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif ()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

View File

@ -1,12 +1,11 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 48c785a..e2b5485 100644
index 534bc311b..f9fb0f1bb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -69,11 +69,3 @@ if(BUILD_GIE)
include(bin_gie.cmake)
set(BIN_TARGETS ${BIN_TARGETS} gie)
@@ -83,10 +83,3 @@ if(BUILD_PROJSYNC)
endif()
-
-if(MSVC OR CMAKE_CONFIGURATION_TYPES)
- if(BIN_TARGETS)
- # Add _d suffix for your debug versions of the tools

View File

@ -1,6 +1,6 @@
Source: spatialite-tools
Version: 4.3.0
Port-Version: 5
Port-Version: 6
Homepage: https://www.gaia-gis.it/fossil/spatialite-tools/index
Description: Contains spatialite.exe and other command line tools to work with SpatiaLite databases (import, export, SQL queries)
Build-Depends: sqlite3, libspatialite, geos, readosm, proj4, zlib, libiconv, expat

View File

@ -54,7 +54,7 @@ set(LIBS_ALL_DBG
${EXPAT_LIBS_DBG} \
${LDIR}/debug/lib/readosm.lib \
${LDIR}/debug/lib/zlibd.lib \
${LDIR}/debug/lib/proj_d.lib"
${LDIR}/debug/lib/proj_d.lib ole32.lib shell32.lib"
)
set(LIBS_ALL_REL
"${ICONV_LIBS_REL} \
@ -65,7 +65,7 @@ set(LIBS_ALL_REL
${EXPAT_LIBS_REL} \
${LDIR}/lib/readosm.lib \
${LDIR}/lib/zlib.lib \
${LDIR}/lib/proj.lib"
${LDIR}/lib/proj.lib ole32.lib shell32.lib"
)
if(BUILD_DEBUG_TOOLS)