I am trying to port qmake
project to meson
build system.
Project is a simple Qt GUI application, with no other dependencies.
Application is cross-platform one, it must compile and run on macOS/Linux/Windows.
Right now i'm stuck on mac.
Debug application binary built by ninja
/meson
unable to load:
mac:~ user$ Projects/qgit/__build__/qgit
dyld: Library not loaded: @rpath/QtCore.framework/Versions/5/QtCore
Referenced from: /Users/eraxillan/Projects/qgit/__build__/qgit
Reason: image not found
Abort trap: 6
Documentation mention two rpath-related parameters:
build_rpath
install_rpath
I've tried both, specifying path to local Qt installation (export DYLD_FRAMEWORK_PATH=/Users/user/Qt/5.12.3/clang_64/lib
), but nothing changes:
mac:test user$ otool -L __build__/test
__build__/test:
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.3)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.3)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.3)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
I expected meson
changes @rpath
to specified, but it don't.
What is my problem, am i doing smth wrong?
P.S. There is a workaround:
export DYLD_FRAMEWORK_PATH=/Users/user/Qt/5.12.3/clang_64/lib
__build__/test
# it now works
P.P.S. meson.build
:
project('test', 'cpp', default_options : ['cpp_std=c++11', 'warning_level=3'])
qt5 = import('qt5')
qt5_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets'])
incdir = include_directories('src')
prep = qt5.preprocess(
moc_headers : test_headers,
ui_files : test_forms,
qresources : test_resources,
include_directories : incdir,
dependencies: qt5_dep)
...
q5exe = executable('test',
sources : [test_sources, prep],
dependencies : [qt5_dep],
include_directories : incdir,
install : true,
build_rpath : '/Users/user/Qt/5.12.3/clang_64/lib',
#install_rpath : '/Users/user/Qt/5.12.3/clang_64/lib'
)