<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Nur Text Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.NurTextZchn
        {mso-style-name:"Nur Text Zchn";
        mso-style-priority:99;
        mso-style-link:"Nur Text";
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoPlainText><span lang=EN-US>Sorry for the MailingList thing, it was a reply mistake.<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>So, here is the complete output:<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack: Enable Verbose<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Read CPack config file: <o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Read CPack configuration file: /home/rowu/MyPackage/CPackConfig.cmake<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Specified generator: DEB<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Use generator: cmCPackDebGenerator<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: For project: MyPackage<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack: Create package using DEB<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Read description file: /opt/cmake-3.8.2-Linux-x86_64/share/cmake-3.8/Templates/CPack.GenericDescription.txt<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: [DEB] requested component grouping = ONE_PER_GROUP<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Remove toplevel directory: /home/rowu/MyPackage/_CPack_Packages/Linux/DEB<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack: Install projects<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack: - Run preinstall target for: MyPackage<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack: - Install project: MyPackage<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Install configuration: "Release"<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Installing: /home/rowu/MyPackage/_CPack_Packages/Linux/DEB/MyPackage-0.0.0.1499458629/opt/MyPackage-0.0.0.1499458629/./testprog<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Set runtime path of "/home/rowu/MyPackage/_CPack_Packages/Linux/DEB/MyPackage-0.0.0.1499458629/opt/MyPackage-0.0.0.1499458629/bin/testprog" to ""<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Installing: /home/rowu/MyPackage/_CPack_Packages/Linux/DEB/MyPackage-0.0.0.1499458629/opt/MyPackage-0.0.0.1499458629/./file1.dat<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: Installing: /home/rowu/MyPackage/_CPack_Packages/Linux/DEB/MyPackage-0.0.0.1499458629/opt/MyPackage-0.0.0.1499458629/./file2.dat<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: fixup_bundle<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose:   app='/opt/MyPackage-0.0.0.1499458629/bin/testprog'<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose:   libs=''<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose:   dirs='/usr/local/lib'<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose:   ignoreItems=''<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: warning: *NOT* handled - directory/file does not exist...<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CMake Error at /opt/cmake-3.8.2-Linux-x86_64/share/cmake-3.8/Modules/BundleUtilities.cmake:956 (message):<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>  error: fixup_bundle: not a valid bundle<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>Call Stack (most recent call first):<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>  /home/rowu/MyPackage/app/testprog/cmake_install.cmake:68 (fixup_bundle)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>  /home/rowu/MyPackage/app/cmake_install.cmake:37 (include)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>  /home/rowu/MyPackage/cmake_install.cmake:37 (include)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoPlainText><span style='font-size:9.0pt;font-family:"Courier New"'>CPack Verbose: fixup_bundle: done<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>CPack Error: Error when generating package: MyPackage<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>Regards<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>Roman<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=DE style='mso-fareast-language:DE-AT'>-----Ursprüngliche Nachricht-----<br>Von: Elvis Stansvik [mailto:elvis.stansvik@orexplore.com] <br>Gesendet: Mittwoch, 19. Juli 2017 20:07<br>An: Roman Wüger <roman.wueger@gmx.at>; CMake MailingList <cmake@cmake.org><br>Betreff: Re: [CMake] CPack install 3rd party shared libraries</span></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>(Adding the mailing list back to the list of recepients - It's always good to keep the discussion on the list)<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>2017-07-19 19:30 GMT+02:00 Roman Wüger <<a href="mailto:roman.wueger@gmx.at"><span style='color:windowtext;text-decoration:none'>roman.wueger@gmx.at</span></a>>:<o:p></o:p></p><p class=MsoPlainText>> Hello Elvis,<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> I tried you solution, but I get always the message:<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> CMake Error at /opt/cmake-3.8.2-Linux-x86_64/share/cmake-3.8/Modules/BundleUtilities.cmake:956 (message):<o:p></o:p></p><p class=MsoPlainText>>   error: fixup_bundle: not a valid bundle<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>It would help to see your full CMake code.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Was there no warning printed before this error? Something like<o:p></o:p></p><p class=MsoPlainText>"warning: *NOT* handled - " followed by an explanation?<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Elvis<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Regards<o:p></o:p></p><p class=MsoPlainText>> Roman<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> -----Ursprüngliche Nachricht-----<o:p></o:p></p><p class=MsoPlainText>> Von: CMake [<a href="mailto:cmake-bounces@cmake.org"><span style='color:windowtext;text-decoration:none'>mailto:cmake-bounces@cmake.org</span></a>] Im Auftrag von Roman Wüger<o:p></o:p></p><p class=MsoPlainText>> Gesendet: Mittwoch, 19. Juli 2017 19:14<o:p></o:p></p><p class=MsoPlainText>> An: 'Elvis Stansvik' <<a href="mailto:elvis.stansvik@orexplore.com"><span style='color:windowtext;text-decoration:none'>elvis.stansvik@orexplore.com</span></a>><o:p></o:p></p><p class=MsoPlainText>> Cc: 'CMake MailingList' <<a href="mailto:cmake@cmake.org"><span style='color:windowtext;text-decoration:none'>cmake@cmake.org</span></a>><o:p></o:p></p><p class=MsoPlainText>> Betreff: Re: [CMake] CPack install 3rd party shared libraries<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Thank you Elvis for the awesome example.<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Best Regards<o:p></o:p></p><p class=MsoPlainText>> Roman<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> -----Ursprüngliche Nachricht-----<o:p></o:p></p><p class=MsoPlainText>> Von: Elvis Stansvik [<a href="mailto:elvis.stansvik@orexplore.com"><span style='color:windowtext;text-decoration:none'>mailto:elvis.stansvik@orexplore.com</span></a>]<o:p></o:p></p><p class=MsoPlainText>> Gesendet: Mittwoch, 19. Juli 2017 16:51<o:p></o:p></p><p class=MsoPlainText>> An: David Cole <<a href="mailto:DLRdave@aol.com"><span style='color:windowtext;text-decoration:none'>DLRdave@aol.com</span></a>><o:p></o:p></p><p class=MsoPlainText>> Cc: Roman Wüger <<a href="mailto:roman.wueger@gmx.at"><span style='color:windowtext;text-decoration:none'>roman.wueger@gmx.at</span></a>>; CMake MailingList <o:p></o:p></p><p class=MsoPlainText>> <<a href="mailto:cmake@cmake.org"><span style='color:windowtext;text-decoration:none'>cmake@cmake.org</span></a>><o:p></o:p></p><p class=MsoPlainText>> Betreff: Re: [CMake] CPack install 3rd party shared libraries<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> 2017-07-19 16:42 GMT+02:00 David Cole <<a href="mailto:DLRdave@aol.com"><span style='color:windowtext;text-decoration:none'>DLRdave@aol.com</span></a>>:<o:p></o:p></p><p class=MsoPlainText>>> Very nice example. Does CMake have a place to put examples like VTK <o:p></o:p></p><p class=MsoPlainText>>> does...? If so, where is it? And if not, it would be super useful to <o:p></o:p></p><p class=MsoPlainText>>> start one somewhere "official."<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> I guess the wiki is for that? Though I think my example should be cleaned up before being put up anywhere.<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>> However, one word of caution on the example. I know it was targeted <o:p></o:p></p><p class=MsoPlainText>>> at Linux, and perhaps for a very simple case it's proper, but using <o:p></o:p></p><p class=MsoPlainText>>> an unconditional "local" for everything in a <o:p></o:p></p><p class=MsoPlainText>>> gp_resolved_file_type_override would not be something you'd want to <o:p></o:p></p><p class=MsoPlainText>>> do in general, especially on Windows. You would end up with probably <o:p></o:p></p><p class=MsoPlainText>>> on the order of a hundred (or maybe nowadays even a few hundred) DLLs <o:p></o:p></p><p class=MsoPlainText>>> from the Windows system directories inside your bundle. Almost <o:p></o:p></p><p class=MsoPlainText>>> certainly not what you intended.<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Yes, good point and I should have said something about that. My example was quick and dirty.<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> In my real projects, I've so far always ended up with separate calls to fixup_bundle for the different platforms anyway (though never used fixup_bundle on Linux before), so I guess my mind was thinking "oh well, this is just for Linux" when I wrote it.<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Elvis<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>> Cheers,<o:p></o:p></p><p class=MsoPlainText>>> David C.<o:p></o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>><o:p> </o:p></p><p class=MsoPlainText>>> On Wed, Jul 19, 2017 at 9:57 AM, Elvis Stansvik <o:p></o:p></p><p class=MsoPlainText>>> <<a href="mailto:elvis.stansvik@orexplore.com"><span style='color:windowtext;text-decoration:none'>elvis.stansvik@orexplore.com</span></a>> wrote:<o:p></o:p></p><p class=MsoPlainText>>>> 2017-07-19 13:42 GMT+02:00 Roman Wüger <<a href="mailto:roman.wueger@gmx.at"><span style='color:windowtext;text-decoration:none'>roman.wueger@gmx.at</span></a>>:<o:p></o:p></p><p class=MsoPlainText>>>>> The problem with BundleUtilities which Inder is that it doesn't support generator expressions.<o:p></o:p></p><p class=MsoPlainText>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>> Maybe I do something wrong?<o:p></o:p></p><p class=MsoPlainText>>>>> But I need to specify the path to the executable (generator expression) and the paths where to look for dependencies. Right?<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> You don't need to use a generator to fetch the executable path. You <o:p></o:p></p><p class=MsoPlainText>>>> will know the path, since you installed the executable with<o:p></o:p></p><p class=MsoPlainText>>>> install(..) :) I think most people essentially hardcode the <o:p></o:p></p><p class=MsoPlainText>>>> executable path in their call to fixup_bundle(..).<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> If you really want to, I think there is a way to use generator <o:p></o:p></p><p class=MsoPlainText>>>> expressions, and that is to put the fixup_bundle(..) call in a <o:p></o:p></p><p class=MsoPlainText>>>> separate file (say InstallStuff.cmake.in), and then process that <o:p></o:p></p><p class=MsoPlainText>>>> file with file(GENERATE OUTPUT ...) [1] to produce <o:p></o:p></p><p class=MsoPlainText>>>> InstallStuff.cmake with generator expressions evaluated and then use <o:p></o:p></p><p class=MsoPlainText>>>> install(SCRIPT InstallStuff.cmake). But that's much too complicated <o:p></o:p></p><p class=MsoPlainText>>>> IMHO, and I would avoid it.<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> I made a minimal example that links against zlib and also the Boost <o:p></o:p></p><p class=MsoPlainText>>>> library you mentioned:<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> cmake_minimum_required(VERSION 2.8)<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> project(bundletest)<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> find_package(ZLIB REQUIRED)<o:p></o:p></p><p class=MsoPlainText>>>> find_package(Boost REQUIRED COMPONENTS filesystem)<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> add_executable(bundletest main.cpp)<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> target_include_directories(bundletest PRIVATE ${ZLIB_INCLUDE_DIRS}<o:p></o:p></p><p class=MsoPlainText>>>> ${Boost_INCLUDE_DIRS})<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> target_link_libraries(bundletest ${ZLIB_LIBRARIES}<o:p></o:p></p><p class=MsoPlainText>>>> ${Boost_LIBRARIES})<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> install(TARGETS bundletest<o:p></o:p></p><p class=MsoPlainText>>>>     RUNTIME DESTINATION "bin"<o:p></o:p></p><p class=MsoPlainText>>>> )<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> install(CODE "<o:p></o:p></p><p class=MsoPlainText>>>>     function(gp_resolved_file_type_override resolved_file type_var)<o:p></o:p></p><p class=MsoPlainText>>>>        set(\${type_var} local PARENT_SCOPE)<o:p></o:p></p><p class=MsoPlainText>>>>     endfunction()<o:p></o:p></p><p class=MsoPlainText>>>>     include(BundleUtilities)<o:p></o:p></p><p class=MsoPlainText>>>>     fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/bin/bundletest\" \"\"<o:p></o:p></p><p class=MsoPlainText>>>> \"\") " COMPONENT Runtime)<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> main.cpp:<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> #include <iostream><o:p></o:p></p><p class=MsoPlainText>>>> #include <zlib.h><o:p></o:p></p><p class=MsoPlainText>>>> #include <boost/filesystem.hpp><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> using namespace boost::filesystem;<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> int main (int argc, char *argv[]) {<o:p></o:p></p><p class=MsoPlainText>>>>     // Pretend we're using zlib and Boost<o:p></o:p></p><p class=MsoPlainText>>>>     deflateInit(0, 0);<o:p></o:p></p><p class=MsoPlainText>>>>     std::cout << file_size(argv[1]) << std::endl;<o:p></o:p></p><p class=MsoPlainText>>>>     return 0;<o:p></o:p></p><p class=MsoPlainText>>>> }<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> The overriding of the gp_resolved_file_type_override was necessary, <o:p></o:p></p><p class=MsoPlainText>>>> to make it treat all libraries as local (otherwise it skips "system"<o:p></o:p></p><p class=MsoPlainText>>>> libraries). See the docs for GetPrerequisites.<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Building/installing this with<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> mkdir build<o:p></o:p></p><p class=MsoPlainText>>>> cd build<o:p></o:p></p><p class=MsoPlainText>>>> cmake -DCMAKE_INSTALL_PREFIX=~/bundletest_install ..<o:p></o:p></p><p class=MsoPlainText>>>> make install<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> produces:<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/bundletest<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libm.so.6<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libstdc++.so.6<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libc.so.6<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libz.so.1<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libpthread.so.0<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libboost_system.so.1.58.0<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libgcc_s.so.1<o:p></o:p></p><p class=MsoPlainText>>>> /home/estan/bundletest_install/bin/libboost_filesystem.so.1.58.0<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> I did the build on Ubuntu, and tested that it also runs in a clean <o:p></o:p></p><p class=MsoPlainText>>>> Fedora 24 Docker container.<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Hope that helps some.<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Elvis<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> [1] <a href="https://cmake.org/cmake/help/v3.9/command/file.html"><span style='color:windowtext;text-decoration:none'>https://cmake.org/cmake/help/v3.9/command/file.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>> Please, could you give me a hint?<o:p></o:p></p><p class=MsoPlainText>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>> Regards<o:p></o:p></p><p class=MsoPlainText>>>>> Roman<o:p></o:p></p><p class=MsoPlainText>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>> Am 19.07.2017 um 12:40 schrieb Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com"><span style='color:windowtext;text-decoration:none'>elvis.stansvik@orexplore.com</span></a>>:<o:p></o:p></p><p class=MsoPlainText>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>> 2017-07-19 10:24 GMT+02:00 Roman Wüger <<a href="mailto:roman.wueger@gmx.at"><span style='color:windowtext;text-decoration:none'>roman.wueger@gmx.at</span></a>>:<o:p></o:p></p><p class=MsoPlainText>>>>>>> Hello,<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> I have a project which depends on a self compiled 3rd party <o:p></o:p></p><p class=MsoPlainText>>>>>>> project (boost) Boost is here only an example, there are other 3rd party libraries too.<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> If I call the "install" command on the target, then it would be packaged.<o:p></o:p></p><p class=MsoPlainText>>>>>>> But how could I add the shared libraries and especially the links for the shared libraries?<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> E.g.:<o:p></o:p></p><p class=MsoPlainText>>>>>>> libboost_filesystem.so -> libboost_filesystem.so.1.48.0<o:p></o:p></p><p class=MsoPlainText>>>>>>> libboost_filesystem.so.1.48.0<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Thanks in advance<o:p></o:p></p><p class=MsoPlainText>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>> I think fixup_bundle() from BundleUtilities is what you want [1].<o:p></o:p></p><p class=MsoPlainText>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>> We're using it to make our Windows and macOS installs standalone, <o:p></o:p></p><p class=MsoPlainText>>>>>> but (I think) it should work on Linux as well.<o:p></o:p></p><p class=MsoPlainText>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>> [1] <a href="https://cmake.org/cmake/help/v3.8/module/BundleUtilities.html"><span style='color:windowtext;text-decoration:none'>https://cmake.org/cmake/help/v3.8/module/BundleUtilities.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Best Regards<o:p></o:p></p><p class=MsoPlainText>>>>>>> Roman<o:p></o:p></p><p class=MsoPlainText>>>>>>> --<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Powered by <a href="http://www.kitware.com"><span style='color:windowtext;text-decoration:none'>www.kitware.com</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Please keep messages on-topic and check the CMake FAQ at:<o:p></o:p></p><p class=MsoPlainText>>>>>>> <a href="http://www.cmake.org/Wiki/CMake_FAQ"><span style='color:windowtext;text-decoration:none'>http://www.cmake.org/Wiki/CMake_FAQ</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> CMake Support: <a href="http://cmake.org/cmake/help/support.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/support.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/consulting.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/training.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Visit other Kitware open-source projects at <o:p></o:p></p><p class=MsoPlainText>>>>>>> <a href="http://www.kitware.com/opensource/opensource.html"><span style='color:windowtext;text-decoration:none'>http://www.kitware.com/opensource/opensource.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>>>>><o:p> </o:p></p><p class=MsoPlainText>>>>>>> Follow this link to subscribe/unsubscribe:<o:p></o:p></p><p class=MsoPlainText>>>>>>> <a href="http://public.kitware.com/mailman/listinfo/cmake"><span style='color:windowtext;text-decoration:none'>http://public.kitware.com/mailman/listinfo/cmake</span></a><o:p></o:p></p><p class=MsoPlainText>>>>><o:p> </o:p></p><p class=MsoPlainText>>>> --<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Powered by <a href="http://www.kitware.com"><span style='color:windowtext;text-decoration:none'>www.kitware.com</span></a><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Please keep messages on-topic and check the CMake FAQ at:<o:p></o:p></p><p class=MsoPlainText>>>> <a href="http://www.cmake.org/Wiki/CMake_FAQ"><span style='color:windowtext;text-decoration:none'>http://www.cmake.org/Wiki/CMake_FAQ</span></a><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> CMake Support: <a href="http://cmake.org/cmake/help/support.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/support.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/consulting.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/training.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Visit other Kitware open-source projects at <o:p></o:p></p><p class=MsoPlainText>>>> <a href="http://www.kitware.com/opensource/opensource.html"><span style='color:windowtext;text-decoration:none'>http://www.kitware.com/opensource/opensource.html</span></a><o:p></o:p></p><p class=MsoPlainText>>>><o:p> </o:p></p><p class=MsoPlainText>>>> Follow this link to subscribe/unsubscribe:<o:p></o:p></p><p class=MsoPlainText>>>> <a href="http://public.kitware.com/mailman/listinfo/cmake"><span style='color:windowtext;text-decoration:none'>http://public.kitware.com/mailman/listinfo/cmake</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> --<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Powered by <a href="http://www.kitware.com"><span style='color:windowtext;text-decoration:none'>www.kitware.com</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Please keep messages on-topic and check the CMake FAQ at: <o:p></o:p></p><p class=MsoPlainText>> <a href="http://www.cmake.org/Wiki/CMake_FAQ"><span style='color:windowtext;text-decoration:none'>http://www.cmake.org/Wiki/CMake_FAQ</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> CMake Support: <a href="http://cmake.org/cmake/help/support.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/support.html</span></a><o:p></o:p></p><p class=MsoPlainText>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/consulting.html</span></a><o:p></o:p></p><p class=MsoPlainText>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html"><span style='color:windowtext;text-decoration:none'>http://cmake.org/cmake/help/training.html</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Visit other Kitware open-source projects at <o:p></o:p></p><p class=MsoPlainText>> <a href="http://www.kitware.com/opensource/opensource.html"><span style='color:windowtext;text-decoration:none'>http://www.kitware.com/opensource/opensource.html</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Follow this link to subscribe/unsubscribe:<o:p></o:p></p><p class=MsoPlainText>> <a href="http://public.kitware.com/mailman/listinfo/cmake"><span style='color:windowtext;text-decoration:none'>http://public.kitware.com/mailman/listinfo/cmake</span></a><o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p></div></body></html>