gcc - How to build cmake-gui with a custom path to qt? -
i trying build cmake-gui
custom path , failed on run:
#/opt/dev-tools-4.9/cmake-gui /opt/dev-tools-4.9/cmake-gui: error while loading shared libraries: libqtgui.so.4: cannot open shared object file: no such file or directory
so want cmake-gui started search qtx @ /opt/dev-tools-4.9 used system
# strace -f ./cmake-gui execve("./cmake-gui", ["./cmake-gui"], [/* 24 vars */]) = 0 brk(0) = 0x13ca000 access("/etc/ld.so.nohwcap", f_ok) = -1 enoent (no such file or directory) mmap(null, 8192, prot_read|prot_write, map_private|map_anonymous, -1, 0) = 0x7fcfdff0b000 access("/etc/ld.so.preload", r_ok) = -1 enoent (no such file or directory) open("/etc/ld.so.cache", o_rdonly|o_cloexec) = 3 fstat(3, {st_mode=s_ifreg|0644, st_size=53974, ...}) = 0 mmap(null, 53974, prot_read, map_private, 3, 0) = 0x7fcfdfefd000 close(3) = 0 access("/etc/ld.so.nohwcap", f_ok) = -1 enoent (no such file or directory) open("/lib/x86_64-linux-gnu/tls/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/x86_64-linux-gnu/tls/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/x86_64-linux-gnu/tls", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/x86_64-linux-gnu/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/x86_64-linux-gnu/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/x86_64-linux-gnu/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/x86_64-linux-gnu", {st_mode=s_ifdir|0755, st_size=12288, ...}) = 0 open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/x86_64-linux-gnu/tls/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/x86_64-linux-gnu/tls", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/x86_64-linux-gnu/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/x86_64-linux-gnu/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/x86_64-linux-gnu", {st_mode=s_ifdir|0755, st_size=32768, ...}) = 0 open("/lib/tls/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/tls/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/tls/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/tls", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/lib/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/lib", {st_mode=s_ifdir|0755, st_size=4096, ...}) = 0 open("/usr/lib/tls/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/tls/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/tls/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/tls", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/x86_64/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib/x86_64", 0x7fffebe47810) = -1 enoent (no such file or directory) open("/usr/lib/libqtgui.so.4", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) stat("/usr/lib", {st_mode=s_ifdir|0755, st_size=4096, ...}) = 0 writev(2, [{"./cmake-gui", 11}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libqtgui.so.4", 13}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"no such file or directory", 25}, {"\n", 1}], 10./cmake-gui: error while loading shared libraries: libqtgui.so.4: cannot open shared object file: no such file or directory ) = 124 exit_group(127) = ? +++ exited 127 +++
i found in lfs example can use custom path qtx:
if qt4 , qt5 installed in /opt, use source setqt4 or source setqt5 choose 1 used build qt-based gui.
but there isn't files:
~# cd cmake-3.5.2 root:~/cmake-3.5.2# ls |grep set root:~/cmake-3.5.2#
the build of libarchive
wget http://www.libarchive.org/downloads/libarchive-3.2.0.tar.gz tar xzvf libarchive-3.2.0.tar.gz ./configure --prefix=/opt/dev-tools-4.9 --disable-static && \ make -j $(nproc || grep -c ^processor /proc/cpuinfo|| echo "1") && \ make install
the build of cmake 2.8.11
wget --no-check-certificate https://cmake.org/files/v2.8/cmake-2.8.11.tar.gz tar xzvf cmake-2.8.11.tar.gz ./bootstrap --prefix=/opt/dev-tools-4.9 \ --no-system-libs --qt-gui && \ make -j $(nproc || grep -c ^processor /proc/cpuinfo|| echo "1") && \ make install
to adjust rpath cmake-gui only, should add source/qtdialog/cmakelists.txt
, after add_executable(cmake-gui....)
:
set_target_properties(cmake-gui properties install_rpath "/opt/path/to/qt/shared/libs" )
don't forget regenerate cmake build files completely. configured build should contain -wl,-rpath,<specified-path>
in linker invocation command in source/qtdialog/cmakefiles/cmake-gui.dir/link.txt
note: checked against cmake-3.2.2, don't think other versions of cmake differ in area.
Comments
Post a Comment