diff --git a/CMakeLists.txt b/CMakeLists.txt index a732d24d..80656e15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,9 @@ if(NOT HAVE_GETOPT_LONG_ONLY) add_subdirectory(getopt) endif() +# For setting rpath in frontend and frontend_qt +set_property(GLOBAL PROPERTY ZINT_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + add_subdirectory(backend) if(ZINT_FRONTEND) add_subdirectory(frontend) diff --git a/ChangeLog b/ChangeLog index e29203f3..edd86cde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,7 +22,8 @@ Bugs - CLI: fix "--scalexdimdp" X-dim inch units being divided instead of multiplied on conversion to mm - DOTCODE: fix not emitting FNC1 (signalling not GS1) if input is just 2 digits -- CMake: set `rpath` of CLI on macOS install (ticket #346, props Hagen Röwer) +- CMake: set `rpath` of CLI/GUI on install (ticket #346, props Hagen Röwer and + Bryce Harrison) - AZTEC: fix ECC to be at least advertised percentages (ticket #347, props Francois Grieu) diff --git a/README.macos b/README.macos index 174bb03a..e2b046b5 100644 --- a/README.macos +++ b/README.macos @@ -1,5 +1,6 @@ -% README.macos 2025-10-02 +% README.macos 2026-01-21 % Tested on macOS 12.7.2 Monterey VirtualBox (thanks to https://github.com/myspaghetti/macos-virtualbox) +% and macOS 14.8.3 Sonoma (thanks to https://github.com/kholia/OSX-KVM) 1. Prerequisites for building zint and zint-qt ============================================== @@ -10,14 +11,11 @@ First if not already installed, install the developer command line tools xcode-select --install -This can take a (very) long time. Once done, check for updates by selecting "System Preferences" > "Software Update", -and clicking "Advanced" and "OK" (with all the checkboxes set) to trigger the check. If updates are found, install. -This can also take a long time. - -With the latest versions of the command line tools, "/usr/include" no longer has the standard C include files. Set -SDKROOT to overcome this (https://stackoverflow.com/a/60002595/664741) +(On Monterey but not Sonoma or later, the latest versions of the command line tools may not have "/usr/include" +in the standard C include directories. Set SDKROOT to overcome this (https://stackoverflow.com/a/60002595/664741) export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) +) Install Homebrew (unless already installed) diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index 2a57bc30..e04ae088 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -24,9 +24,8 @@ if(NOT HAVE_GETOPT_LONG_ONLY) target_link_libraries(${PROJECT_NAME} zint_bundled_getopt) endif() -if(APPLE AND NOT CMAKE_INSTALL_RPATH) - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -endif() +get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR) +set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}") install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME) if(UNIX) diff --git a/frontend_qt/CMakeLists.txt b/frontend_qt/CMakeLists.txt index e420de34..a6fd902c 100644 --- a/frontend_qt/CMakeLists.txt +++ b/frontend_qt/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu > -# Copyright (C) 2009-2025 Robin Stuart +# Copyright (C) 2009-2026 Robin Stuart # SPDX-License-Identifier: GPL-3.0-or-later # vim: set ts=4 sw=4 et : @@ -52,4 +52,7 @@ target_link_libraries(${PROJECT_NAME} QZint Qt${QT_VERSION_MAJOR}::UiTools Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Core) +get_property(libdir GLOBAL PROPERTY ZINT_LIBDIR) +set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${libdir}") + install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME)