zxing-cpp offline patch
by lucabon from LinuxQuestions.org on (#6CX0B)
The package "kde/zxing-cpp" silently download the dependency "stb" from https://github.com/nothings/stb
I think it would be preferable to have the dependency in the source tree, avoiding online download.
The following could be a patch (I'm not a cmake expert, for sure it could be better...) after placing the download package in "cmake-build/_deps/stb-src":
Code:--- zxing-cpp-2.1.0/zxing.cmake.orig 2023-07-05 18:25:57.000000000 +0200
+++ zxing-cpp-2.1.0/zxing.cmake 2023-07-08 10:31:41.752325124 +0200
@@ -12,11 +12,8 @@
if (NOT STB_FOUND)
include(FetchContent)
- FetchContent_Declare (stb
- GIT_REPOSITORY https://github.com/nothings/stb.git)
- FetchContent_MakeAvailable (stb)
add_library(stb::stb INTERFACE IMPORTED)
- target_include_directories(stb::stb INTERFACE ${stb_SOURCE_DIR})
+ target_include_directories(stb::stb INTERFACE ../cmake-build/_deps/stb-src)
else()
add_library(stb::stb ALIAS PkgConfig::STB)
endif()
I think it would be preferable to have the dependency in the source tree, avoiding online download.
The following could be a patch (I'm not a cmake expert, for sure it could be better...) after placing the download package in "cmake-build/_deps/stb-src":
Code:--- zxing-cpp-2.1.0/zxing.cmake.orig 2023-07-05 18:25:57.000000000 +0200
+++ zxing-cpp-2.1.0/zxing.cmake 2023-07-08 10:31:41.752325124 +0200
@@ -12,11 +12,8 @@
if (NOT STB_FOUND)
include(FetchContent)
- FetchContent_Declare (stb
- GIT_REPOSITORY https://github.com/nothings/stb.git)
- FetchContent_MakeAvailable (stb)
add_library(stb::stb INTERFACE IMPORTED)
- target_include_directories(stb::stb INTERFACE ${stb_SOURCE_DIR})
+ target_include_directories(stb::stb INTERFACE ../cmake-build/_deps/stb-src)
else()
add_library(stb::stb ALIAS PkgConfig::STB)
endif()