On OS X, add the Qt -Wl,-rpath hack in CMake, as we do with autotools.

Change-Id: I281e1bf790b7eefbbd43a3406622262cfe8b36df
Reviewed-on: https://code.wireshark.org/review/9651
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-07-15 16:04:57 -07:00
parent 85f8a99f35
commit 4a39706272
1 changed files with 17 additions and 1 deletions

View File

@ -1715,7 +1715,23 @@ if(BUILD_wireshark AND QT_FOUND)
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/wireshark)
endif()
target_link_libraries(wireshark ${wireshark_LIBS})
if(APPLE)
#
# On Darwin, find where the Qt frameworks are
# located, and add that to the rpath, just in
# case this is Qt 5.5 or later and the frameworks
# have an install name that begins with @rpath
# and aren't installed in a frameworks directory
# that's searched by default.
#
# It would be *amazingly convenient* if we
# could get that from Qt's CMake configuration
# files, but we can't, so we have to extract it from
# an internal variable.
#
set(wireshark_rpath_flag "-Wl,-rpath,${_qt5Core_install_prefix}/lib")
endif(APPLE)
target_link_libraries(wireshark ${wireshark_rpath_flag} ${wireshark_LIBS})
install(
TARGETS wireshark
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}