| 1 | Ref https://github.com/raspberrypi/rpi-imager/issues/924
|
| 2 |
|
| 3 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
| 4 | index 247e1d03..3001405a 100644
|
| 5 | |
| 6 | |
| 7 | @@ -155,27 +155,26 @@ set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
| 8 | set(BUILD_STATIC_LIBS ON)
|
| 9 | set(BUILD_SHARED_LIBS OFF)
|
| 10 |
|
| 11 | -include(FetchContent)
|
| 12 | -include(dependencies/fetch-vendor.cmake)
|
| 13 | +find_package(PkgConfig REQUIRED)
|
| 14 |
|
| 15 | # Bundled liblzma
|
| 16 | -include(dependencies/xz.cmake)
|
| 17 | +pkg_check_modules(LibLZMA REQUIRED IMPORTED_TARGET liblzma)
|
| 18 |
|
| 19 | # Bundled zstd
|
| 20 | -include(dependencies/zstd.cmake)
|
| 21 | +pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET libzstd)
|
| 22 |
|
| 23 | # Remote nghttp2
|
| 24 | -include(dependencies/nghttp2.cmake)
|
| 25 | +pkg_check_modules(NGHTTP2 REQUIRED IMPORTED_TARGET libnghttp2)
|
| 26 |
|
| 27 | # Bundled yescrypt
|
| 28 | include(dependencies/yescrypt.cmake)
|
| 29 |
|
| 30 |
|
| 31 | # Bundled zlib
|
| 32 | -include(dependencies/zlib.cmake)
|
| 33 | +pkg_check_modules(ZLIB REQUIRED IMPORTED_TARGET zlib)
|
| 34 |
|
| 35 | # Bundled libarchive
|
| 36 | -include(dependencies/libarchive.cmake)
|
| 37 | +pkg_check_modules(LibArchive REQUIRED IMPORTED_TARGET libarchive)
|
| 38 |
|
| 39 | # libcurl
|
| 40 | if(APPLE)
|
| 41 | @@ -189,12 +188,12 @@ if(APPLE)
|
| 42 | # Note: No need to find OpenSSL on macOS - we use native Security.framework
|
| 43 | # for RSA operations and CommonCrypto for hashing
|
| 44 | else()
|
| 45 | - include(dependencies/curl.cmake)
|
| 46 | + pkg_check_modules(CURL REQUIRED IMPORTED_TARGET libcurl)
|
| 47 | endif()
|
| 48 |
|
| 49 |
|
| 50 | # Bundled libusb (for rpiboot Compute Module support)
|
| 51 | -include(dependencies/libusb.cmake)
|
| 52 | +pkg_check_modules(LIBUSB REQUIRED IMPORTED_TARGET libusb-1.0)
|
| 53 |
|
| 54 | # Add dependencies
|
| 55 | if (APPLE)
|
| 56 | @@ -540,12 +539,12 @@ else()
|
| 57 | include(linux/PlatformPackaging.cmake)
|
| 58 | endif()
|
| 59 |
|
| 60 | -add_dependencies(${PROJECT_NAME} zlibstatic yescrypt usb-1.0-static)
|
| 61 | -include_directories(${CURL_INCLUDE_DIR} ${LibArchive_INCLUDE_DIR} ${LIBLZMA_INCLUDE_DIRS} ${LIBDRM_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR} ${YESCRYPT_INCLUDE_DIR} ${LIBUSB_INCLUDE_DIR})
|
| 62 | +add_dependencies(${PROJECT_NAME} yescrypt)
|
| 63 | +include_directories(${LIBDRM_INCLUDE_DIRS} ${YESCRYPT_INCLUDE_DIR})
|
| 64 |
|
| 65 | # Link different Qt components based on build type
|
| 66 | # rpiboot link libraries (libusb)
|
| 67 | -set(RPIBOOT_LIBS ${LIBUSB_LIBRARIES})
|
| 68 | +set(RPIBOOT_LIBS PkgConfig::LIBUSB)
|
| 69 |
|
| 70 | if(BUILD_CLI_ONLY)
|
| 71 | # CLI-only build: link Core, Network and essential libraries
|
| 72 | @@ -555,7 +554,7 @@ else()
|
| 73 | # DBus on Linux for suspend inhibitor, portal file dialogs and URI handler;
|
| 74 | # excluded for embedded (no session bus on the netboot image).
|
| 75 | if(UNIX AND NOT APPLE AND NOT BUILD_EMBEDDED)
|
| 76 | - target_link_libraries(${PROJECT_NAME} PRIVATE ${QT}::Core ${QT}::Gui ${QT}::Quick ${QT}::Svg ${QT}::Network ${QT}::DBus ${CURL_LIBRARIES} ${LibArchive_LIBRARIES} ${ZSTD_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${YESCRYPT_LIBRARIES} ${LIBDRM_LIBRARIES} ${ATOMIC_LIBRARY} ${RPIBOOT_LIBS} ${EXTRALIBS})
|
| 77 | + target_link_libraries(${PROJECT_NAME} PRIVATE ${QT}::Core ${QT}::Gui ${QT}::Quick ${QT}::Svg ${QT}::Network ${QT}::DBus PkgConfig::CURL PkgConfig::LibArchive PkgConfig::ZSTD PkgConfig::LibLZMA PkgConfig::ZLIB ${YESCRYPT_LIBRARIES} ${LIBDRM_LIBRARIES} ${ATOMIC_LIBRARY} ${RPIBOOT_LIBS} ${EXTRALIBS})
|
| 78 | else()
|
| 79 | target_link_libraries(${PROJECT_NAME} PRIVATE ${QT}::Core ${QT}::Gui ${QT}::Quick ${QT}::Svg ${QT}::Network ${CURL_LIBRARIES} ${LibArchive_LIBRARIES} ${ZSTD_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${YESCRYPT_LIBRARIES} ${LIBDRM_LIBRARIES} ${ATOMIC_LIBRARY} ${RPIBOOT_LIBS} ${EXTRALIBS})
|
| 80 | endif()
|