comparison mupdf-source/thirdparty/zxing-cpp/zxing.cmake @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1
2 macro(zxing_add_package_stb)
3 unset (STB_FOUND CACHE)
4
5 if (ZXING_DEPENDENCIES STREQUAL "AUTO")
6 find_package(PkgConfig)
7 pkg_check_modules (STB IMPORTED_TARGET stb)
8 elseif (ZXING_DEPENDENCIES STREQUAL "LOCAL")
9 find_package(PkgConfig REQUIRED)
10 pkg_check_modules (STB REQUIRED IMPORTED_TARGET stb)
11 endif()
12
13 if (NOT STB_FOUND)
14 include(FetchContent)
15 FetchContent_Declare (stb
16 GIT_REPOSITORY https://github.com/nothings/stb.git)
17 FetchContent_MakeAvailable (stb)
18 add_library(stb::stb INTERFACE IMPORTED)
19 target_include_directories(stb::stb INTERFACE ${stb_SOURCE_DIR})
20 else()
21 add_library(stb::stb ALIAS PkgConfig::STB)
22 endif()
23 endmacro()
24
25 macro(zxing_add_package name depname git_repo git_rev)
26 unset(${name}_FOUND CACHE) # see https://github.com/zxing-cpp/zxing-cpp/commit/8db14eeead45e0f1961532f55061d5e4dd0f78be#commitcomment-66464026
27
28 if (ZXING_DEPENDENCIES STREQUAL "AUTO")
29 find_package (${name} CONFIG)
30 elseif (ZXING_DEPENDENCIES STREQUAL "LOCAL")
31 find_package (${name} REQUIRED CONFIG)
32 endif()
33
34 if (NOT ${name}_FOUND)
35 include(FetchContent)
36 FetchContent_Declare (${depname}
37 GIT_REPOSITORY ${git_repo}
38 GIT_TAG ${git_rev})
39 if (${depname} STREQUAL "googletest")
40 # Prevent overriding the parent project's compiler/linker settings on Windows
41 set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
42 endif()
43 #FetchContent_MakeAvailable (${depname})
44 # TODO: reqire cmake 3.28 and pass EXCLUDE_FROM_ALL to FetchContent_Declare instead of calling FetchContent_Populate below.
45 # This would fix a warning but cmake 3.28 is not in Debian bookworm but at least in Ubuntu 24.04 (LTS)
46 FetchContent_GetProperties(${depname})
47 if(NOT ${depname}_POPULATED)
48 FetchContent_Populate(${depname})
49 add_subdirectory(${${depname}_SOURCE_DIR} ${${depname}_BINARY_DIR} EXCLUDE_FROM_ALL) # prevent installing of dependencies
50 endif()
51 set (${name}_POPULATED TRUE) # this is supposed to be done in MakeAvailable but it seems not to?!?
52 endif()
53 endmacro()