[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 diff --git a/CMakeLists.txt b/CMakeLists.txt
index e90fcdd..17c79e8 100644 index e90fcdd..17c79e8 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ add_library(LercLib ${SOURCES}) @@ -26,9 +26,16 @@ add_library(LercLib ${SOURCES})
target_link_libraries (LercLib) endif()
install( install(
- TARGETS LercLib TARGETS Lerc
+ TARGETS LercLib EXPORT LercTargets + EXPORT LercTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -28,3 +28,9 @@ install( PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES "include/Lerc_types.h" "include/Lerc_c_api.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
) )
+ +target_include_directories(Lerc PUBLIC "$<INSTALL_INTERFACE:include>")
+install(EXPORT LercTargets +install(EXPORT LercTargets
+ FILE lercConfig.cmake + FILE unofficial-lerc-config.cmake
+ NAMESPACE Esri:: + NAMESPACE unofficial::Lerc::
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/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( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO Esri/lerc REPO Esri/lerc
REF v2.2 REF v3.0
SHA512 5ddf1e8f0c123d3c1329e980021e25e6ff9b79c96588115e5b48ba7637f0b2bf3ebb2ab6ebf94cfbde45ea1521f14405f669e23f0b74d9ae8f9b2cf80a908215 SHA512 8e04d890c4d46528641b354ec3f47f2b0563e1740927ac894925a30f7de2b235cb3517ce7e477886bd3eb50ebd6c6e78f22d73d5500877e552d9e684e626293b
HEAD_REF master HEAD_REF master
PATCHES PATCHES
"install_lib_to_archive_path.patch"
"enable_static_build.patch"
"create_package.patch" "create_package.patch"
) )
vcpkg_configure_cmake( vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
) )
vcpkg_cmake_install()
vcpkg_install_cmake() vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-lerc)
vcpkg_fixup_cmake_targets()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") 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", "name": "lerc",
"version-string": "2.2", "version": "3.0",
"port-version": 2,
"description": "An open-source image or raster format which supports rapid encoding and decoding for any pixel type", "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 "port-version": 0
}, },
"lerc": { "lerc": {
"baseline": "2.2", "baseline": "3.0",
"port-version": 2 "port-version": 0
}, },
"lest": { "lest": {
"baseline": "1.35.1", "baseline": "1.35.1",

View File

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