From f7c0efc0d07bf997de11584af7b48890085c0d53 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 16 Sep 2025 10:36:05 +0200 Subject: [PATCH 1/2] Add new package OpenJPH 0.23.0 Add upstream version of package `OpenJPH`. The `TIFF` dependency is optional and I had some issues when adding `hunter_add_package(TIFF)` with missing includes. So adding with `TIFF` disabled. Fixes: https://github.com/cpp-pm/hunter/issues/805 --- cmake/configs/default.cmake | 1 + cmake/projects/OpenJPH/hunter.cmake | 33 +++++++++++++++++++++++++++++ docs/packages/pkg/OpenJPH.md | 21 ++++++++++++++++++ examples/OpenJPH/CMakeLists.txt | 18 ++++++++++++++++ examples/OpenJPH/boo.cpp | 13 ++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 cmake/projects/OpenJPH/hunter.cmake create mode 100644 docs/packages/pkg/OpenJPH.md create mode 100644 examples/OpenJPH/CMakeLists.txt create mode 100644 examples/OpenJPH/boo.cpp diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 58e6f50bf0..8f7e9d9dca 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -107,6 +107,7 @@ hunter_default_version(OpenCV VERSION 4.10.0-p0) hunter_default_version(OpenCV-Extra VERSION 4.10.0) hunter_default_version(OpenEXR VERSION 3.1.5-p0) hunter_default_version(OpenGL-Registry VERSION 0.0.0-d15191e-p0) +hunter_default_version(OpenJPH VERSION 0.23.0) hunter_default_version(OpenNMTTokenizer VERSION 1.11.0-p1) hunter_default_version(OpenSSL VERSION 3.0.12) hunter_default_version(OpenSceneGraph VERSION 3.6.3-p0) diff --git a/cmake/projects/OpenJPH/hunter.cmake b/cmake/projects/OpenJPH/hunter.cmake new file mode 100644 index 0000000000..fff3c454ec --- /dev/null +++ b/cmake/projects/OpenJPH/hunter.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + OpenJPH + VERSION + 0.23.0 + URL + "https://github.com/aous72/OpenJPH/archive/0.23.0.tar.gz" + SHA1 + a702c867373b58dca9fe7a61f46b3ef440161d68 +) + +hunter_cmake_args( + OpenJPH + CMAKE_ARGS + OJPH_ENABLE_TIFF_SUPPORT=NO # 0.23.0 not hunterized, no dependencies allowed + OJPH_BUILD_EXECUTABLES=NO + OJPH_BUILD_TESTS=NO +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenJPH) +hunter_download(PACKAGE_NAME OpenJPH) diff --git a/docs/packages/pkg/OpenJPH.md b/docs/packages/pkg/OpenJPH.md new file mode 100644 index 0000000000..37eb04227f --- /dev/null +++ b/docs/packages/pkg/OpenJPH.md @@ -0,0 +1,21 @@ +```{spelling:word-list} + +OpenJPH +``` + +```{index} single: media ; OpenJPH +``` + +(pkg.OpenJPH)= + +# OpenJPH + +- [Official](https://github.com/aous72/OpenJPH) +- [Example](https://github.com/cpp-pm/hunter/blob/master/examples/OpenJPH/CMakeLists.txt) +- Added by [NeroBurner](https://github.com/NeroBurner) ([pr-814](https://github.com/cpp-pm/hunter/pull/814)) + +```{literalinclude} /../examples/OpenJPH/CMakeLists.txt +:language: cmake +:start-after: "# DOCUMENTATION_START {" +:end-before: "# DOCUMENTATION_END }" +``` diff --git a/examples/OpenJPH/CMakeLists.txt b/examples/OpenJPH/CMakeLists.txt new file mode 100644 index 0000000000..6ffe014a64 --- /dev/null +++ b/examples/OpenJPH/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.10) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-OpenJPH) + +# DOCUMENTATION_START { +hunter_add_package(OpenJPH) +find_package(OpenJPH CONFIG REQUIRED) + +add_executable(boo boo.cpp) +target_link_libraries(boo PUBLIC openjph) +# DOCUMENTATION_END } diff --git a/examples/OpenJPH/boo.cpp b/examples/OpenJPH/boo.cpp new file mode 100644 index 0000000000..1c33141427 --- /dev/null +++ b/examples/OpenJPH/boo.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main() { + std::cout << "OpenJPH version: " + << OPENJPH_VERSION_MAJOR << "." + << OPENJPH_VERSION_MINOR << "." + << OPENJPH_VERSION_PATCH << std::endl; + std::cout << "arch level: " << ojph::get_cpu_ext_level() << std::endl; + return 0; +} From 4629970471026885ff80f05f1c01915388a08b81 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Tue, 16 Sep 2025 11:03:39 +0200 Subject: [PATCH 2/2] OpenJPH: update copyright in example and hunter.cmake --- cmake/projects/OpenJPH/hunter.cmake | 2 +- examples/OpenJPH/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/projects/OpenJPH/hunter.cmake b/cmake/projects/OpenJPH/hunter.cmake index fff3c454ec..410c779a87 100644 --- a/cmake/projects/OpenJPH/hunter.cmake +++ b/cmake/projects/OpenJPH/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov +# Copyright (c) 2025, NeroBurner # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! diff --git a/examples/OpenJPH/CMakeLists.txt b/examples/OpenJPH/CMakeLists.txt index 6ffe014a64..6e714db8fe 100644 --- a/examples/OpenJPH/CMakeLists.txt +++ b/examples/OpenJPH/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov +# Copyright (c) 2025, NeroBurner # All rights reserved. cmake_minimum_required(VERSION 3.10)