I think you need to do the NSIS script by hand to see what it looks like and then ask the question "how can I get CPack to use a project.nsi file that looks like this?"<div><br></div><div><br><br><div class="gmail_quote">
On Mon, May 21, 2012 at 2:22 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>I think one solution could be that the files must be copied with add_custom_command's, then run configure_file with the NSIS template to be able to use @ variables and then another add_custom_command to run NSIS.</div>
<div><br></div><div>Is there maybe a simpler solution or is this the correct way?</div><div><br><br>Am 21.05.2012 um 20:05 schrieb <a href="mailto:norulez@me.com" target="_blank">norulez@me.com</a>:<br><br></div><div><div class="h5">
<div></div><blockquote type="cite"><div><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><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><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><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></blockquote><blockquote type="cite"><div><span>--</span><br><span></span><br><span>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br><span></span><br><span>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></span><br>
<span></span><br><span>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></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br>
<span><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a></span></div></blockquote></div></div></div></blockquote></div><br></div>