parent
ae793c41d7
commit
8e77e9ac64
@ -1 +1 @@
|
||||
/zxing-cpp-1.2.0.tar.gz
|
||||
/zxing-cpp-2.0.0.tar.gz
|
||||
|
@ -1,76 +0,0 @@
|
||||
From 8db14eeead45e0f1961532f55061d5e4dd0f78be Mon Sep 17 00:00:00 2001
|
||||
From: Paul Wise <pabs3@bonedaddy.net>
|
||||
Date: Thu, 26 Aug 2021 22:03:00 +0800
|
||||
Subject: [PATCH] Add a mode to build against system versions of dependencies
|
||||
|
||||
Make the default be to use system versions when available,
|
||||
but allow always using them or never using them.
|
||||
|
||||
Add searching for and using system versions of fmt/googletest/pybind11,
|
||||
which are currently pulled directly from git using FetchContent.
|
||||
|
||||
This will allow distributions that do not allow network access at build
|
||||
time to depend on and build against these packages.
|
||||
|
||||
Fixes: https://github.com/nu-book/zxing-cpp/issues/248
|
||||
---
|
||||
CMakeLists.txt | 7 +++++++
|
||||
test/blackbox/CMakeLists.txt | 18 +++++++++++++-----
|
||||
1 files changed, 54 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 1361792..2b522e0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -8,6 +8,7 @@ option (BUILD_EXAMPLES "Build the example barcode reader/writer applicatons" ON)
|
||||
option (BUILD_BLACKBOX_TESTS "Build the black box reader/writer tests" ON)
|
||||
option (BUILD_UNIT_TESTS "Build the unit tests (don't enable for production builds)" OFF)
|
||||
option (BUILD_PYTHON_MODULE "Build the python module" OFF)
|
||||
+set(BUILD_SYSTEM_DEPS "AUTO" CACHE STRING "Use system dependencies (AUTO/ALWAYS/NEVER)")
|
||||
|
||||
if (WIN32)
|
||||
option (BUILD_SHARED_LIBS "Build and link as shared library" OFF)
|
||||
@@ -53,6 +54,12 @@ if (BUILD_UNIT_TESTS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+set(BUILD_SYSTEM_DEPS_LIST AUTO ALWAYS NEVER)
|
||||
+set_property(CACHE BUILD_SYSTEM_DEPS PROPERTY STRINGS ${BUILD_SYSTEM_DEPS_LIST})
|
||||
+if(NOT BUILD_SYSTEM_DEPS IN_LIST BUILD_SYSTEM_DEPS_LIST)
|
||||
+ message(FATAL_ERROR "BUILD_SYSTEM_DEPS must be one of ${BUILD_SYSTEM_DEPS_LIST}")
|
||||
+endif()
|
||||
+
|
||||
add_subdirectory (core)
|
||||
|
||||
enable_testing()
|
||||
diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt
|
||||
index 3da26dd..9d79e8e 100644
|
||||
--- a/test/blackbox/CMakeLists.txt
|
||||
+++ b/test/blackbox/CMakeLists.txt
|
||||
@@ -1,10 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
-include(FetchContent)
|
||||
-FetchContent_Declare (fmtlib
|
||||
- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
|
||||
- GIT_TAG 7.1.2)
|
||||
-FetchContent_MakeAvailable (fmtlib) # Adds fmt::fmt
|
||||
+if (BUILD_SYSTEM_DEPS STREQUAL "AUTO")
|
||||
+ find_package (fmt)
|
||||
+elseif (BUILD_SYSTEM_DEPS STREQUAL "ALWAYS")
|
||||
+ find_package (fmt REQUIRED)
|
||||
+endif()
|
||||
+
|
||||
+if (NOT fmt_FOUND)
|
||||
+ include(FetchContent)
|
||||
+ FetchContent_Declare (fmtlib
|
||||
+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git
|
||||
+ GIT_TAG 7.1.2)
|
||||
+ FetchContent_MakeAvailable (fmtlib) # Adds fmt::fmt
|
||||
+endif()
|
||||
|
||||
if (BUILD_READERS)
|
||||
add_executable (ReaderTest
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,11 +0,0 @@
|
||||
diff -ru zxing-cpp-1.2.0.orig/core/src/textcodec/JPTextEncoder.h zxing-cpp-1.2.0/core/src/textcodec/JPTextEncoder.h
|
||||
--- zxing-cpp-1.2.0.orig/core/src/textcodec/JPTextEncoder.h 2023-01-23 20:12:39.682731359 +0000
|
||||
+++ zxing-cpp-1.2.0/core/src/textcodec/JPTextEncoder.h 2023-01-23 20:13:32.420223873 +0000
|
||||
@@ -61,6 +61,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class JPTextEncoder
|
@ -1,42 +0,0 @@
|
||||
From 3872abbb33ebb8d6c891baff33778aae04f0c546 Mon Sep 17 00:00:00 2001
|
||||
From: axxel <awagger@gmail.com>
|
||||
Date: Tue, 26 Jul 2022 22:42:00 +0200
|
||||
Subject: [PATCH] test: update to libfmt v9.0.0
|
||||
|
||||
---
|
||||
test/blackbox/BlackboxTestRunner.cpp | 8 ++++----
|
||||
test/blackbox/CMakeLists.txt | 2 +-
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/test/blackbox/BlackboxTestRunner.cpp b/test/blackbox/BlackboxTestRunner.cpp
|
||||
index 7e126a62..85c5b9d4 100644
|
||||
--- a/test/blackbox/BlackboxTestRunner.cpp
|
||||
+++ b/test/blackbox/BlackboxTestRunner.cpp
|
||||
@@ -158,8 +158,7 @@
|
||||
auto folderName = directory.stem();
|
||||
|
||||
if (Size(imgPaths) != totalTests)
|
||||
- fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName, totalTests,
|
||||
- imgPaths.size());
|
||||
+ fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName.string(), totalTests, imgPaths.size());
|
||||
|
||||
for (auto& test : tests) {
|
||||
fmt::print("{:20} @ {:3}, {:3}", folderName.string(), test.rotation, Size(imgPaths));
|
||||
@@ -234,7 +233,7 @@
|
||||
}
|
||||
|
||||
if (Size(imageGroups) != totalTests)
|
||||
- fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName, totalTests,
|
||||
+ fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName.string(), totalTests,
|
||||
imageGroups.size());
|
||||
|
||||
for (auto& test : tests) {
|
||||
@@ -445,7 +444,7 @@
|
||||
{ 17, 20, 0 },
|
||||
{ 19, 20, 180 },
|
||||
});
|
||||
-
|
||||
+
|
||||
runTests("upca-extension-1", "UPC-A", 6, {
|
||||
{ 3, 6, 0 },
|
||||
{ 4, 6, 180 },
|
@ -1 +1 @@
|
||||
SHA512 (zxing-cpp-1.2.0.tar.gz) = e61b4e44ccaf0871b5d8badf9ce0a81576f55e5d6a9458907b9b599a66227adceabb8d51a0c47b32319d8aeff93e758b4785d3bd0440375247471d95999de487
|
||||
SHA512 (zxing-cpp-2.0.0.tar.gz) = fa22164f834a42194eafd0d3e9c09d953233c69843ac6e79c8d6513314be28d8082382b436c379368e687e0eed05cb5e566d2893ec6eb29233a36643904ae083
|
||||
|
@ -1,18 +1,37 @@
|
||||
diff -Naur zxing-cpp-1.2.0-original/wrappers/python/CMakeLists.txt zxing-cpp-1.2.0/wrappers/python/CMakeLists.txt
|
||||
--- zxing-cpp-1.2.0-original/wrappers/python/CMakeLists.txt 2021-05-28 06:47:09.000000000 -0400
|
||||
+++ zxing-cpp-1.2.0/wrappers/python/CMakeLists.txt 2021-12-13 20:31:22.286170793 -0500
|
||||
@@ -1,13 +1,7 @@
|
||||
@@ -1,8 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(ZXingPython)
|
||||
|
||||
-# get pybind11
|
||||
-include(FetchContent)
|
||||
-#set(FETCHCONTENT_QUIET Off)
|
||||
-FetchContent_Declare (pybind11
|
||||
- GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
||||
- GIT_TAG v2.6.2)
|
||||
-FetchContent_MakeAvailable (pybind11)
|
||||
-set (pybind11_git_repo https://github.com/pybind/pybind11.git)
|
||||
-set (pybind11_git_rev v2.10.2)
|
||||
+find_package(pybind11)
|
||||
|
||||
# check if we are called from the top-level ZXing project
|
||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
||||
@@ -21,14 +20,8 @@
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../core ZXing EXCLUDE_FROM_ALL)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../zxing.cmake)
|
||||
- zxing_add_package(pybind11 pybind11 ${pybind11_git_repo} ${pybind11_git_rev})
|
||||
else()
|
||||
# we don't have access to the top-level cmake helpers -> simply fetch it unconditional
|
||||
- include(FetchContent)
|
||||
- FetchContent_Declare (pybind11
|
||||
- GIT_REPOSITORY ${pybind11_git_repo}
|
||||
- GIT_TAG ${pybind11_git_rev})
|
||||
- FetchContent_MakeAvailable (pybind11)
|
||||
|
||||
# Building from python source distribution (which does not include the whole repository but only python part)
|
||||
# so we need to get c++ source git to build the python extension. The python distribution version (given in
|
||||
@@ -54,8 +47,6 @@
|
||||
add_subdirectory(${zxing-cpp_SOURCE_DIR}/core ZXing EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
-else()
|
||||
- zxing_add_package(pybind11 pybind11 ${pybind11_git_repo} ${pybind11_git_rev})
|
||||
endif()
|
||||
|
||||
# build the python module
|
||||
|
Loading…
Reference in new issue