<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Daniel,<div class=""><br class=""></div><div class="">Thanks for the email, I was trying different combinations of CMAKE_INSTALL_RPATH, with full and relative paths and were not working, I did not about the link flags, thanks for the advice I will test it. </div><div class=""><br class=""></div><div class="">Also, the relative onces is not clear for me, if I set <span style="font-family: Tahoma; font-size: 10pt;" class=""> </span><span class="">"$ORIGIN/../lib”, this is reconstructed from the installation directory of the executable of from cpack tmp directory where is copy during the packaged process.</span></div><span class=""><div class=""><span class=""><br class=""></span></div><div class="">In this topic are missing examples in the CMake documentation (<a href="https://cmake.org/Wiki/CMake_RPATH_handling" class="">https://cmake.org/Wiki/CMake_RPATH_handling</a>), here they do not mention nothing about the flags also.</div><br class=""></span><div class="">Also, I am completely agree with you regarding the OpenGL, vary too much between the different venders.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class=""><br class=""></div><div class="">Waldo<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 13 Dec 2017, at 20:32, Daniel Schepler <<a href="mailto:dschepler@scalable-networks.com" class="">dschepler@scalable-networks.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">You would need to set the INSTALL_RPATH property of the targets to something like "$ORIGIN/../lib" .<br class=""><br class="">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 class=""><br class="">(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 class="">--<span class="Apple-converted-space"> </span><br class="">Daniel Schepler<br class=""><div style="font-family: "Times New Roman"; font-size: 16px;" class=""><hr tabindex="-1" class=""><div id="divRpF444995" style="direction: ltr;" class=""><font size="2" face="Tahoma" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>CMake [<a href="mailto:cmake-bounces@cmake.org" class="">cmake-bounces@cmake.org</a>] on behalf of Waldo Valenzuela via CMake [<a href="mailto:cmake@cmake.org" class="">cmake@cmake.org</a>]<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, December 13, 2017 11:15 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Miklos Espak<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:cmake@cmake.org" class="">cmake@cmake.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [CMake] CMake fixup_bundle for ubuntu 16.04<br class=""></font><br class=""></div><div class=""></div><div class="">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 class=""><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 class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:cmake@cmake.org" class="" target="_blank">cmake@cmake.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); 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<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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<span class="Apple-converted-space"> </span><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><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" class="">http://www.cmake.org/Wiki/CMake_FAQ</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Kitware offers various services to support the CMake community. For more information on each offering, please visit:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">CMake Support: <a href="http://cmake.org/cmake/help/support.html" class="">http://cmake.org/cmake/help/support.html</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" class="">http://cmake.org/cmake/help/consulting.html</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" class="">http://cmake.org/cmake/help/training.html</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Follow this link to subscribe/unsubscribe:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="http://public.kitware.com/mailman/listinfo/cmake" class="">http://public.kitware.com/mailman/listinfo/cmake</a></span></div></blockquote></div><br class=""></div></body></html>