aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libaec
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libaec
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libaec')
-rw-r--r--vcpkg/ports/libaec/cmake-config.patch58
-rw-r--r--vcpkg/ports/libaec/portfile.cmake24
-rw-r--r--vcpkg/ports/libaec/static-shared.patch30
-rw-r--r--vcpkg/ports/libaec/usage7
-rw-r--r--vcpkg/ports/libaec/vcpkg.json18
5 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/libaec/cmake-config.patch b/vcpkg/ports/libaec/cmake-config.patch
new file mode 100644
index 0000000..808e221
--- /dev/null
+++ b/vcpkg/ports/libaec/cmake-config.patch
@@ -0,0 +1,58 @@
+diff --git a/cmake/libaec-config.cmake.in b/cmake/libaec-config.cmake.in
+index 11ac99e..03b96aa 100644
+--- a/cmake/libaec-config.cmake.in
++++ b/cmake/libaec-config.cmake.in
+@@ -36,7 +36,7 @@ if (libaec_USE_STATIC_LIBS OR (NOT DEFINED libaec_USE_STATIC_LIBS AND NOT "@BUIL
+ endif ()
+ else ()
+ find_library(libaec_LIBRARY NAMES aec DOC "AEC library")
+- find_library(SZIP_LIBRARY NAMES sz szip DOC "SZIP compatible version of the AEC library")
++ find_library(SZIP_LIBRARY NAMES sz szip NAMES_PER_DIR DOC "SZIP compatible version of the AEC library")
+ endif ()
+
+ # Check version here
+@@ -55,6 +55,7 @@ find_package_handle_standard_args(libaec
+ )
+
+ if (libaec_FOUND)
++ if(0)
+ if (libaec_USE_STATIC_LIBS)
+ add_library(libaec::aec STATIC IMPORTED)
+ else ()
+@@ -87,6 +88,8 @@ if (libaec_FOUND)
+ IMPORTED_LOCATION "${SZIP_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIR}"
+ )
++ endif()
++ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
+
+ # Set SZIP variables.
+ set(SZIP_FOUND TRUE)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b2aeb6c..1fb3b6d 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -77,9 +77,22 @@ set_target_properties(aec sz
+
+ if(BUILD_SHARED_LIBS)
+ set(install_targets aec_shared sz_shared)
++ set_target_properties(aec_shared PROPERTIES EXPORT_NAME aec INTERFACE_COMPILE_DEFINITIONS LIBAEC_SHARED)
++ set_target_properties(sz_shared PROPERTIES EXPORT_NAME sz INTERFACE_COMPILE_DEFINITIONS LIBAEC_SHARED)
+ set_target_properties(aec_static graec sz_static PROPERTIES EXCLUDE_FROM_ALL 1)
+ else()
+ set(install_targets aec_static sz_static)
++ set_target_properties(aec_static PROPERTIES EXPORT_NAME aec PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/../include/libaec.h")
++ set_target_properties(sz_static PROPERTIES EXPORT_NAME sz PUBLIC_HEADER ../include/szlib.h)
+ set_target_properties(aec_shared graec sz_shared PROPERTIES EXCLUDE_FROM_ALL 1)
+ endif()
+-install(TARGETS ${install_targets})
++set_target_properties(aec PROPERTIES EXPORT_NAME aec_obj)
++set_target_properties(sz PROPERTIES EXPORT_NAME sz_obj)
++install(TARGETS ${install_targets} aec sz
++ EXPORT ${PROJECT_NAME}-targets
++)
++install(
++ EXPORT ${PROJECT_NAME}-targets
++ NAMESPACE ${PROJECT_NAME}::
++ DESTINATION cmake
++)
diff --git a/vcpkg/ports/libaec/portfile.cmake b/vcpkg/ports/libaec/portfile.cmake
new file mode 100644
index 0000000..d3b54b9
--- /dev/null
+++ b/vcpkg/ports/libaec/portfile.cmake
@@ -0,0 +1,24 @@
+vcpkg_from_gitlab(
+ OUT_SOURCE_PATH SOURCE_PATH
+ GITLAB_URL https://gitlab.dkrz.de
+ REPO k202009/libaec
+ REF v1.1.3
+ SHA512 6f317d08ad7d003bc6664da147321eb87c924978f32bd28780a8ebf015e251019046b0cb16b78e776cd1957a7701215667f64686efb8e5c6bae7c08528cede56
+ PATCHES
+ static-shared.patch
+ cmake-config.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTING=OFF
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH "cmake")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/libaec/static-shared.patch b/vcpkg/ports/libaec/static-shared.patch
new file mode 100644
index 0000000..0454a6f
--- /dev/null
+++ b/vcpkg/ports/libaec/static-shared.patch
@@ -0,0 +1,30 @@
+diff --git a/cmake/libaec-config.cmake.in b/cmake/libaec-config.cmake.in
+index 6f6c9e9..11ac99e 100644
+--- a/cmake/libaec-config.cmake.in
++++ b/cmake/libaec-config.cmake.in
+@@ -26,7 +26,7 @@
+
+ find_path(libaec_INCLUDE_DIR NAMES libaec.h DOC "AEC include directory")
+ find_path(SZIP_INCLUDE_DIR NAMES szlib.h DOC "SZIP include directory")
+-if (libaec_USE_STATIC_LIBS)
++if (libaec_USE_STATIC_LIBS OR (NOT DEFINED libaec_USE_STATIC_LIBS AND NOT "@BUILD_SHARED_LIBS@"))
+ if (MSVC)
+ find_library(libaec_LIBRARY NAMES aec-static.lib DOC "AEC library")
+ find_library(SZIP_LIBRARY NAMES szip-static.lib DOC "SZIP compatible version of the AEC library")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index f9c3031..b2aeb6c 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -75,4 +75,11 @@ set_target_properties(aec sz
+ PROPERTIES
+ COMPILE_DEFINITIONS "${libaec_COMPILE_DEFINITIONS}")
+
+-install(TARGETS aec_static aec_shared sz_static sz_shared)
++if(BUILD_SHARED_LIBS)
++ set(install_targets aec_shared sz_shared)
++ set_target_properties(aec_static graec sz_static PROPERTIES EXCLUDE_FROM_ALL 1)
++else()
++ set(install_targets aec_static sz_static)
++ set_target_properties(aec_shared graec sz_shared PROPERTIES EXCLUDE_FROM_ALL 1)
++endif()
++install(TARGETS ${install_targets})
diff --git a/vcpkg/ports/libaec/usage b/vcpkg/ports/libaec/usage
new file mode 100644
index 0000000..a6aeb5f
--- /dev/null
+++ b/vcpkg/ports/libaec/usage
@@ -0,0 +1,7 @@
+libaec provides CMake targets:
+
+ find_package(libaec CONFIG REQUIRED)
+ # libaec API
+ target_link_libraries(main PRIVATE libaec::aec)
+ # szip compatible API
+ target_link_libraries(main PRIVATE libaec::sz)
diff --git a/vcpkg/ports/libaec/vcpkg.json b/vcpkg/ports/libaec/vcpkg.json
new file mode 100644
index 0000000..bfde441
--- /dev/null
+++ b/vcpkg/ports/libaec/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "libaec",
+ "version": "1.1.3",
+ "port-version": 1,
+ "description": "Adaptive Entropy Coding library",
+ "homepage": "https://gitlab.dkrz.de/k202009/libaec",
+ "license": "BSD-2-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}