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

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