<div class="gmail_quote">On Mon, May 21, 2012 at 2:05 PM, <span dir="ltr"><<a href="mailto:norulez@me.com" target="_blank">norulez@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF"><div>But what about other systems like linux. If I have an executable and shared libraries for example.</div><div>Then it is possible to install it under /opt/myproject, but it is not possible to install the executable under /usr/bin and the shared libraries under /usr/lib? Or did I misunderstood something?</div>
</div></blockquote><div><br></div><div>But you don't build an NSIS installer based on those.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF"><div><br></div><div>Sorry, for simple installers the default NSIS template is great, but for customized ones it seems to be very difficult, isn't it?</div></div></blockquote><div><br></div><div>
Yes, you're correct. It takes some effort if you are not installing everything underneath the directory that the end user chooses for your final location.</div><div><br></div><div>It's quite good for "simple installers" and "component-based installers" -- beyond that, and especially putting things outside the location chosen by the end user ... you're on your own.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF"><div><br></div><div><br></div><div>Best Regards</div><div><br>Am 21.05.2012 um 19:27 schrieb David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>>:<br>
<br></div><div><div class="h5"><div></div><blockquote type="cite"><div>The install rule:<div><br><div><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:'courier new',monospace;font-size:12px"> install(FILES ${CMAKE_SOURCE_DIR}/somefolder/myfile.txt DESTINATION $CustomDir)</span><br>
<br></div><div>doesn't make sense because $CustomDir is not known at CMake-time or even at build-time or install-time. It's not known except to NSIS at packaging time.</div><div><br></div><div>make install runs before NSIS runs.</div>
<div><br></div><div>Sounds like you need a completely custom installer -- if you have installed files that are not contained within the make install tree prefix, then you cannot use the recursive "install all files from one root" technique in the NSIS script that CPack uses by default.</div>
<div><br></div><div><br></div><div>We generally encourage and expect a "re-locatable" install tree to be used with the CPack built NSIS installers. (i.e. -- no matter where the end-user finally installs your package, they will be able to run the installed programs just fine.) That's why the entire install tree is copied using the following:</div>
<div><div><br></div><div> this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", </div><div> "File /r \"${INST_DIR}\\*.*\"");</div></div><div><br></div><div>That results in the following generated in project.nsi:</div>
<div><br></div><div> File /r "${INST_DIR}\*.*"</div><div><br></div><div>which installs all files and directories recursively (from your make install tree) to the installation directory chosen by the end user of your installation program.</div>
<div><br></div><div><br></div><div>This stuff is not easy, especially when we can't see your code.</div><div><br></div><div>Cheers, (& good luck),</div><div>David</div><div><br></div><div><br></div><div><div class="gmail_quote">
On Mon, May 21, 2012 at 12:39 PM, NoRulez <span dir="ltr"><<a href="mailto:norulez@me.com" target="_blank">norulez@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>Hi,<br><br>I know that the install commands collect files and copy them into the temporary cpack directory for the specified generator.<br>How is it possible to install an application for example into those folders:<br>
<span style="font-family:courier new,monospace;font-size:12px">C:\myapp</span><br><span style="font-family:courier new,monospace;font-size:12px">C:\somefolder</span><br><br>I defined '<span style="font-family:courier new,monospace;color:rgb(6,6,6);font-size:12px">Var CustomDir="C:\somefolder"</span>' in the NSIS template.<br>
<br>When I then use the following in the CMakeLists.txt:<br><span style="font-family:courier new,monospace;font-size:12px">install(FILES ${CMAKE_SOURCE_DIR}/somefolder/myfile.txt DESTINATION $CustomDir)</span><br><br>Then the files are installed in <span style="font-family:courier new,monospace;font-size:12px">_CPACK_PACKAGES/NSIS/myproject_1.0.0.1/$CustomDir</span>.<br>
The generated project.nsi has the content: <span style="font-size:12px;font-family:courier new,monospace">$INSTDIR\$CustomDir\...</span><br><br>How can I avoid that <span style="font-family:courier new,monospace;font-size:12px">$INSTDIR\</span> is added, or did I need to use the install command in a different way?<br>
<br>Thanks in advance<br><br>Best Regards<span><font color="#888888"><br>NoRulez<br></font></span></div></div><br>--<br>
<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></div>
</div></blockquote></div></div></div></blockquote></div><br>