1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-23 11:56:03 +00:00

cmake: rpath take 2, re previous commit [eea16e], use global

property `ZINT_LIBDIR` hack to set in both CLI and GUI, whether
  macOS or not (ticket #346, props Hagen Röwer and Bryce Harrison)
This commit is contained in:
gitlost
2026-01-21 22:41:18 +00:00
parent 0efc4fb021
commit 1ba5ba41fb
5 changed files with 16 additions and 12 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -1,5 +1,5 @@
# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu >
# Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com>
# Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
# 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)