Makes sense once you know. Thanks a lot, I would have searched a long time for that.<div><br></div><div>s.<br><br><div class="gmail_quote">On Fri, Mar 18, 2011 at 2:44 AM, Tyler <span dir="ltr">&lt;<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>It&#39;s a little obtuse but you need to use \${CMAKE_INSTALL_PREFIX} in that first argument to fixup_bundle(). If you don&#39;t, ${CMAKE_INSTALL_PREFIX} will be evaluated at CMake-time and therefore point to your build-time install directory. You want to delay evaluation of that variable until CPack time, when it will evaluate to the install directory that CPack uses.</div>

<div><br></div><div>If it makes you feel any better, it took me and another developer quite a while to figure this out in our own project :).</div><div><br></div>Take a look at the ${CMAKE_BINARY_DIR}/cmake_install.cmake generated for your project to see what I mean.<div>

<br></div><div>hth,</div><div>tyler<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Mar 17, 2011 at 2:14 PM, Simon Drouin <span dir="ltr">&lt;<a href="mailto:drouin.simon@gmail.com" target="_blank">drouin.simon@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">I&#39;m trying to use CPack to create a .tar.gz package on linux. I use fixup_bundle from the bundle utility to copy and fix Qt libraries to the bundle. <div>


<br></div><div>When I use simple &#39;make install&#39;, everything is installed properly in directory specified by CMAKE_INSTALL_PREFIX. When I use CPack, the Qt libraries are still copied to the CMAKE_INSTALL_PREFIX directory and not the package&#39;s directory. Here&#39;s the code:</div>



<div><br></div><div>
<table style="margin-top:4px;margin-bottom:4px;margin-left:4px;margin-right:4px">
<tbody><tr>
<td style="border:none">
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000"># install executable(s)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">install</span>( TARGETS <span style="color:#800000">${exec_name}</span> DESTINATION . )</pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><font color="#008000"><br></font></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000"># fixup the bundle</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( APPS <span style="color:#800000">${CMAKE_INSTALL_PREFIX}</span>/<span style="color:#800000">${exec_name}</span> )</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">list</span>( APPEND libSearchDirs <span style="color:#800000">${QT_LIBRARY_DIR}</span>)</pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( additionalLib <span style="color:#800000">${qtsvgiconplugin}</span> )</pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">INSTALL</span>(CODE <span style="color:#008000">&quot;include(BundleUtilities)</span></pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000">    fixup_bundle(\&quot;</span><span style="color:#800000">${APPS}</span><span style="color:#008000">\&quot; \&quot;</span><span style="color:#800000">${additionalLib}</span><span style="color:#008000">\&quot; \&quot;</span><span style="color:#800000">${libSearchDirs}</span><span style="color:#008000">\&quot;)&quot;</span> COMPONENT Runtime)</pre>



<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000">#================================</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000"># Packaging</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#008000">#================================</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_DESCRIPTION_SUMMARY <span style="color:#008000">&quot;My test package&quot;</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_NAME <span style="color:#800000">${exec_name}</span> )</pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_CONTACT <span style="color:#008000">&quot;John Smith&quot;</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_VENDOR <span style="color:#008000">&quot;Company inc.&quot;</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_VERSION_MAJOR <span style="color:#800000">${PROG_MAJOR_VERSION}</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_VERSION_MINOR <span style="color:#800000">${PROG</span><span style="color:#800000">_MINOR_VERSION}</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_VERSION_PATCH <span style="color:#800000">${PROG</span><span style="color:#800000">_PATCH_VERSION}</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_GENERATOR <span style="color:#008000">&quot;TGZ&quot;</span>)</pre>

<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">set</span>( CPACK_PACKAGE_FILE_NAME <span style="color:#008000">&quot;</span><span style="color:#800000">${CPACK_PACKAGE_NAME}</span><span style="color:#008000">-</span><span style="color:#800000">${CPACK_PACKAGE_VERSION_MAJOR}</span><span style="color:#008000">.</span><span style="color:#800000">${CPACK_PACKAGE_VERSION_MINOR}</span><span style="color:#008000">.</span><span style="color:#800000">${CPACK_PACKAGE_VERSION_PATCH}</span><span style="color:#008000">-</span><span style="color:#800000">${CMAKE_SYSTEM_PROCESSOR}</span><span style="color:#008000">&quot;</span>)</pre>




<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#0000ff">include</span>(CPack)</pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
<br></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Am I missing something?</pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
<br></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">s.</pre></td></tr></tbody></table></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>
</div>
</blockquote></div><br></div>