<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body class="" style="word-wrap:break-word; line-break:after-white-space" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">You would need to set the INSTALL_RPATH property of the targets to something like "$ORIGIN/../lib" .<br>
<br>
You might also need to add "-Wl,--disable-new-dtags" to the CMAKE_*_LINK_FLAGS variables - otherwise, the RPATH settings will only take effect for direct dependencies of the executables (and any plugins or shared libraries) you build but not for dependencies
 of these dependencies.<br>
<br>
(We also tend not to include copies of glibc or OpenGL libraries - for the former, that tends to have issues if there are any mismatches between the exact build of glibc included in the installer and the NSS modules from the system.  For the latter, the OpenGL
 libraries vary too much between Mesa and the NVidia and AMD proprietary driver versions for any one of them to work on all systems.)<br>
-- <br>
Daniel Schepler<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF444995" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>From:</b> CMake [cmake-bounces@cmake.org] on behalf of Waldo Valenzuela via CMake [cmake@cmake.org]<br>
<b>Sent:</b> Wednesday, December 13, 2017 11:15 AM<br>
<b>To:</b> Miklos Espak<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] CMake fixup_bundle for ubuntu 16.04<br>
</font><br>
</div>
<div></div>
<div>Dear Miklos,
<div class=""><br class="">
</div>
<div class="">thanks for the email, and your suggestions, but the problem with fixup_bundle in ubuntu is that is not fixing the libraries locations from the executables meaning:</div>
<div class=""><br class="">
</div>
<div class="">if I execute the idd command like this “ idd ./app” where “app” is the executable, the locations of the library is still is “no found", that should be in the location that was copy after running the INSTALL.</div>
<div class=""><br class="">
</div>
<div class="">when you set LD_LIBRARY_PATH is for a temporally solution, or permanent if I modified the environment configuration of O.S.. The idea is that I want to create a standalone application.</div>
<div class=""><br class="">
</div>
<div class="">Under this scenario, if I have an executable called “app” and a shared library call “lib.so”, fixup_bundle should fix the location of the “lib.so” in the same folder where is “app”.</div>
<div class=""><br class="">
</div>
<div class="">Then if I run the command "idd ./app” the output should be:</div>
<div class=""><br class="">
</div>
<div class="">lib.so => “xxxx”, where xxxx is folder where is located “app"</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class=""><br class="">
</div>
<div class="">Waldo.</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 13 Dec 2017, at 03:58, Miklos Espak <<a href="mailto:espakm@gmail.com" class="" target="_blank">espakm@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi,
<div class=""><br class="">
</div>
<div class="">you need to add the directory where the Qt libs have been installed (along with your application binaries) to the LD_LIBRARY_PATH. In your case it is <span class="" style="font-size:12.8px">'/home/waldo/Developer/</span><wbr class="" style="font-size:12.8px"><span class="" style="font-size:12.8px">install/Release/bratumia/bin/',
 as I see.</span>
<div class=""><br class="">
</div>
<div class="">Also, you do *not* need to add the Qt plugin directories to the library path. The plugins are loaded at run-time. So that they can be found, you need to install a qt.conf file in the bin directory with the following contents:</div>
<div class=""><br class="">
</div>
<div class="">[Paths]</div>
<div class="">Prefix=.</div>
<div class=""><br class="">
</div>
<div class="">You also do *not* need to add "/usr/lib" and "/usr/lib/x86-..." to the library path. These libraries are searched for by default. If you did it because your Qt installation is there, that's wrong. The fixup_bundle function should have copied the
 necessary Qt libs in the install bin folder, so you just need to add that folder to the path.</div>
<div class=""><br class="">
</div>
<div class="">Also, make sure that the DIRS variable contains all the directories where there are libraries to install, including dependencies.</div>
<div class=""><br class="">
</div>
<div class="">I hope that helps.</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class="">Miklos</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On 11 December 2017 at 19:07, Waldo Valenzuela via CMake
<span dir="ltr" class=""><<a href="mailto:cmake@cmake.org" class="" target="_blank">cmake@cmake.org</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Dear All,<br class="">
<br class="">
I am working on a multi-platform desktop app with Qt5-VTK8, on Windows and Mac no problem to created the standalone app, but in Ubuntu 16.04  I have several problems.<br class="">
<br class="">
I am using CodeBlocks to compile and run the app, and from CodeBlocks when I run the app there is no problem, it work normally like in windows and mac, but after run the installation, and If I want to run the app from the installation folder (./app ) I have
 several problems.<br class="">
<br class="">
<br class="">
the CMakeList.txt is<br class="">
<br class="">
FILE(GLOB_RECURSE QTPLUGINS_IMAGEFORMATS ${QT_BASE_DIRECTORY}/plugins/<wbr class="">imageformats/*${CMAKE_SHARED_<wbr class="">LIBRARY_SUFFIX})<br class="">
FILE(GLOB_RECURSE QTPLUGINS_PLATFORMS ${QT_BASE_DIRECTORY}/plugins/<wbr class="">platforms/*${CMAKE_SHARED_<wbr class="">LIBRARY_SUFFIX})<br class="">
<br class="">
SET(QTPLUGINS ${QTPLUGINS_IMAGEFORMATS} ${QTPLUGINS_PLATFORMS})<br class="">
<br class="">
MESSAGE("Project libraries: ${QTPLUGINS}")<br class="">
<br class="">
<br class="">
INSTALL(CODE "<br class="">
        INCLUDE(BundleUtilities)<br class="">
        FIXUP_BUNDLE(\"${APPS}\" \"${QTPLUGINS}\" \"${DIRS}\")<br class="">
             "<br class="">
        COMPONENT ${PROJECT_NAME})<br class="">
<br class="">
First I have this:<br class="">
<br class="">
-- fixup_bundle: fixing...<br class="">
-- 132/260: fix-up not required on this platform '/home/waldo/Developer/Qt/5.6.<wbr class="">3/gcc_64/plugins/imageformats/<wbr class="">libqicns.so'<br class="">
-- 133/260: fix-up not required on this platform '/home/waldo/Developer/<wbr class="">install/Release/bratumia/bin/<wbr class="">libQt5Core.so.5'<br class="">
-- 134/260: fix-up not required on this platform '/home/waldo/Developer/<wbr class="">install/Release/bratumia/bin/<wbr class="">libQt5Gui.so.5’<br class="">
<br class="">
-- 167/260: fix-up not required on this platform '/home/waldo/Developer/<wbr class="">install/Release/bratumia/bin/<wbr class="">libITKEXPAT-4.13.so.1'<br class="">
-- 168/260: fix-up not required on this platform '/home/waldo/Developer/<wbr class="">install/Release/bratumia/bin/<wbr class="">libITKIOBMP-4.13.so.1'<br class="">
-- 169/260: fix-up not required on this platform '/home/waldo/Developer/<wbr class="">install/Release/bratumia/bin/<wbr class="">libITKIOBioRad-4.13.so.1<br class="">
<br class="">
then when I run: ldd ./app I have:<br class="">
<br class="">
        libQt5Concurrent.so.5 => not found<br class="">
        libvtkRenderingImage-9.0.so.1 => not found<br class="">
        libvtkRenderingVolumeOpenGL2-<wbr class="">9.0.so.1 => not found<br class="">
<br class="">
then if I fix manually the path of the libraries like this:<br class="">
<br class="">
export LD_LIBRARY_PATH="$LD_LIBRARY_<wbr class="">PATH:/usr/lib:/usr/lib/x86_64-<wbr class="">linux-gnu:/home/waldo/app/bin/<wbr class="">plugins/imageformats:/home/<wbr class="">waldo/app/bin/plugins/<wbr class="">platforms"<br class="">
<br class="">
I can run the application from through the command line from the installation folder, but I have this message and I can not see nothing<br class="">
<br class="">
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled<br class="">
QOpenGLWidget: Failed to create context<br class="">
composeAndFlush: makeCurrent() failed<br class="">
<br class="">
<br class="">
I think that the FIXUP_BUNDLE is doing nothing.<br class="">
<br class="">
Any help is welcome.<br class="">
<br class="">
Best regards,<br class="">
<br class="">
Waldo.<br class="">
--<br class="">
<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" class="" target="_blank">
www.kitware.com</a><br class="">
<br class="">
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" class="" target="_blank">
http://www.cmake.org/Wiki/<wbr class="">CMake_FAQ</a><br class="">
<br class="">
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br class="">
<br class="">
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" class="" target="_blank">
http://cmake.org/cmake/help/<wbr class="">support.html</a><br class="">
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" class="" target="_blank">
http://cmake.org/cmake/help/<wbr class="">consulting.html</a><br class="">
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" class="" target="_blank">
http://cmake.org/cmake/help/<wbr class="">training.html</a><br class="">
<br class="">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" class="" target="_blank">
http://www.kitware.com/<wbr class="">opensource/opensource.html</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" class="" target="_blank">http://public.kitware.com/<wbr class="">mailman/listinfo/cmake</a></blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>