[lerc] Update to 3.0, move config to unofficial (#24634)

* Update to 3.0

* Modernize portfile

* Install NOTICE as required by license

* Move CMake config to unofficial namespace

The target name changed, so old configs would break anyways,
without polyfill. The unofficial namespace reflects such risks.

* Add include path to CMake config

* Update versions
This commit is contained in:
Kai Pastor 2022-05-10 20:37:35 +02:00 committed by GitHub
parent a6a97cd1fc
commit acca474962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 63 deletions

View File

@ -1,26 +1,21 @@
CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e90fcdd..17c79e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ add_library(LercLib ${SOURCES})
target_link_libraries (LercLib)
@@ -26,9 +26,16 @@ add_library(LercLib ${SOURCES})
endif()
install(
- TARGETS LercLib
+ TARGETS LercLib EXPORT LercTargets
TARGETS Lerc
+ EXPORT LercTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -28,3 +28,9 @@ install(
FILES "include/Lerc_types.h" "include/Lerc_c_api.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
+
+target_include_directories(Lerc PUBLIC "$<INSTALL_INTERFACE:include>")
+install(EXPORT LercTargets
+ FILE lercConfig.cmake
+ NAMESPACE Esri::
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/lerc"
+ FILE unofficial-lerc-config.cmake
+ NAMESPACE unofficial::Lerc::
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-lerc"
+)

View File

@ -1,16 +0,0 @@
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d22ad11..e90fcdd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ file(GLOB SOURCES
)
message(${SOURCES})
-add_library(LercLib SHARED ${SOURCES})
+add_library(LercLib ${SOURCES})
target_link_libraries (LercLib)

View File

@ -1,16 +0,0 @@
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ececeed..d22ad11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ install(
TARGETS LercLib
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

View File

@ -1,24 +1,20 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Esri/lerc
REF v2.2
SHA512 5ddf1e8f0c123d3c1329e980021e25e6ff9b79c96588115e5b48ba7637f0b2bf3ebb2ab6ebf94cfbde45ea1521f14405f669e23f0b74d9ae8f9b2cf80a908215
REF v3.0
SHA512 8e04d890c4d46528641b354ec3f47f2b0563e1740927ac894925a30f7de2b235cb3517ce7e477886bd3eb50ebd6c6e78f22d73d5500877e552d9e684e626293b
HEAD_REF master
PATCHES
"install_lib_to_archive_path.patch"
"enable_static_build.patch"
"create_package.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-lerc)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${SOURCE_PATH}/NOTICE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,7 +1,17 @@
{
"name": "lerc",
"version-string": "2.2",
"port-version": 2,
"version": "3.0",
"description": "An open-source image or raster format which supports rapid encoding and decoding for any pixel type",
"homepage": "https://github.com/Esri/lerc"
"homepage": "https://github.com/Esri/lerc",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -3369,8 +3369,8 @@
"port-version": 0
},
"lerc": {
"baseline": "2.2",
"port-version": 2
"baseline": "3.0",
"port-version": 0
},
"lest": {
"baseline": "1.35.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3037b9fd610059bc84e89607a3e58aa13641cdd8",
"version": "3.0",
"port-version": 0
},
{
"git-tree": "81c91f19fa142f53370b1a7ecac53fd2ba10aaf6",
"version-string": "2.2",