early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,66 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d736d129..2be8f8be9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,7 +129,22 @@ if(NOT EXE_SQLITE3)
message(SEND_ERROR "sqlite3 binary not found!")
endif()
-find_package(Sqlite3 REQUIRED)
+find_package(unofficial-sqlite3 CONFIG REQUIRED)
+if(unofficial-sqlite3_FOUND)
+ set(SQLITE3_FOUND true)
+ get_target_property(SQLITE3_INCLUDE_DIR unofficial::sqlite3::sqlite3 INTERFACE_INCLUDE_DIRECTORIES)
+ set(SQLITE3_LIBRARY unofficial::sqlite3::sqlite3)
+ # Extract version information from the header file
+ if(SQLITE3_INCLUDE_DIR)
+ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line
+ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
+ LIMIT_COUNT 1)
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
+ SQLITE3_VERSION "${_ver_line}")
+ unset(_ver_line)
+ endif()
+endif()
+
if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
@@ -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")
@@ -171,6 +188,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/project-config.cmake.in b/cmake/project-config.cmake.in
index 23f997abd..8baef00f0 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -7,6 +7,17 @@
# @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)
+cmake_policy(PUSH)
+cmake_policy(SET CMP0012 NEW)
+include(CMakeFindDependencyMacro)
+find_dependency(unofficial-sqlite3 CONFIG)
+if("@ENABLE_TIFF@")
+ find_dependency(TIFF)
+endif()
+if("@ENABLE_CURL@")
+ find_dependency(CURL CONFIG)
+endif()
+cmake_policy(POP)
# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)

View File

@@ -0,0 +1,13 @@
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index 6f43edb5c..1ed89d597 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -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_NAME}_ABI_VERSION}" abilen)
if(abilen GREATER 0)
set(SUFFIX "_${${PROJECT_NAME}_ABI_VERSION}")

69
externals/vcpkg/ports/proj/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,69 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OSGeo/PROJ
REF 9.0.0
SHA512 f11a20e9f9615c513755f54ac400cc2e144e40caa91f616c8f640aef9caf779487dc94927b3a4b57b15a595c17b70636b872d9a77d7baaf912b1a507004e6520
HEAD_REF master
PATCHES
fix-win-output-name.patch
fix-proj4-targets-cmake.patch
tools-cmake.patch
)
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)
set(BUILD_PROJSYNC OFF)
vcpkg_list(APPEND FEATURE_OPTIONS -DBUILD_PROJSYNC=${BUILD_PROJSYNC})
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
-DPROJ_LIB_SUBDIR=lib
-DPROJ_INCLUDE_SUBDIR=include
-DPROJ_DATA_SUBDIR=share/${PORT}/data
-DBUILD_TESTING=OFF
"-DEXE_SQLITE3=${EXE_SQLITE3}"
)
vcpkg_cmake_install()
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()
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)
if ("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif ()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_copy_pdbs()
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()
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)

15
externals/vcpkg/ports/proj/tools-cmake.patch vendored Executable file
View File

@@ -0,0 +1,15 @@
diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt
index 534bc311b..f9fb0f1bb 100644
--- a/src/apps/CMakeLists.txt
+++ b/src/apps/CMakeLists.txt
@@ -83,10 +83,3 @@ if(BUILD_PROJSYNC)
# global configurations for all apps
-if(MSVC OR CMAKE_CONFIGURATION_TYPES)
- if(BIN_TARGETS)
- # Add _d suffix for debug versions of the apps
- set_target_properties(${BIN_TARGETS} PROPERTIES
- DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
- endif()
-endif()

4
externals/vcpkg/ports/proj/usage vendored Executable file
View File

@@ -0,0 +1,4 @@
The package proj provides CMake targets:
find_package(PROJ CONFIG REQUIRED)
target_link_libraries(main PRIVATE PROJ::proj)

57
externals/vcpkg/ports/proj/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,57 @@
{
"name": "proj",
"version": "9.0.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,
"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"
}
}
}