Use:<div><br></div><div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"> DESTINATION ${PROJECT_NAME}</span><br><br></div><div>instead of the full path you're trying to use.</div>
<div><br></div><div>If you use a full path in a CMake install rule, then CPack does not put it inside the directory that NSIS packs up to build the installer... If you use a non-full path, then for "make install" it gets put under CMAKE_INSTALL_PREFIX, and for the CPack-based install, it gets put in the directory that NSIS packs up...</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Tue, Feb 21, 2012 at 12:40 PM, Andrea Crotti <span dir="ltr"><<a href="mailto:andrea.crotti.0@gmail.com">andrea.crotti.0@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to finally create an installer for my project, with CPack and NSIS.<br>
<br>
The project is really really simple, I just need to copy over a directory somewhere.<br>
And I did something like:<br>
<br>
get_filename_component(<u></u>userprofile $ENV{USERPROFILE} REALPATH)<br>
<br>
install(<br>
DIRECTORY ${EGG_BUILD_DIRECTORY}<br>
DESTINATION ${userprofile}/${PROJECT_NAME}<br>
)<br>
<br>
<br>
The first line is because CPack was exploding using the USERPROFILE, because<br>
it was getting non quoted backslash.<br>
<br>
So is it the way to handle windows path variables?<br>
<br>
The packing, however, doesn't work and I get something like (from the NSIS generated log file):<br>
<br>
!insertmacro: end of MUI_RESERVEFILE_INSTALLOPTIONS<br>
Section: "-Core installation"<br>
SetOutPath: "$INSTDIR"<br>
File: Returning to: "H:/long_path/_CPack_Packages/<u></u>win32/NSIS/Minimum Drag-0.1.1-win32"<br>
File: "H:/long_path/_CPack_Packages/<u></u>win32/NSIS/Minimum Drag-0.1.1-win32\*.*" -> no files found.<br>
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |<br>
/oname=outfile one_file_only)<br>
Error in script "H:/git_projs/Minimum_Drag/<u></u>airbus.application.minimum_<u></u>drag/_CPack_Packages/win32/<u></u>NSIS/project.nsi" on line 640 -- aborting creation process<br>
<br>
These are the variables that I defined<br>
set(CPACK_NSIS_INSTALLED_ICON_<u></u>NAME "${PROJECT_NAME}")<br>
set(CPACK_PACKAGE_ICON "Company")<br>
set(CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME})<br>
<br>
set(CPACK_RESOURCE_FILE_<u></u>LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/<u></u>COPYRIGHT.txt")<br>
set(CPACK_PACKAGE_VERSION_<u></u>MAJOR 0)<br>
set(CPACK_PACKAGE_VERSION_<u></u>MINOR 1)<br>
set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}")<br>
set(CPACK_PACKAGE_INSTALL_<u></u>DIRECTORY "${PROJECT_NAME}") # add the version numbers<br>
set(CPACK_PACKAGE_DESCRIPTION "Package ${PROJECT_NAME}")<br>
<br>
<br>
is there anything missing?<br>
Any idea what that could be?<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/<u></u>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/<u></u>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/<u></u>listinfo/cmake</a><br>
</blockquote></div><br></div>