[CMake] cpack issues

David Cole david.cole at kitware.com
Tue Feb 21 13:07:28 EST 2012


Use:

  DESTINATION ${PROJECT_NAME}

instead of the full path you're trying to use.

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...


HTH,
David


On Tue, Feb 21, 2012 at 12:40 PM, Andrea Crotti
<andrea.crotti.0 at gmail.com>wrote:

> I'm trying to finally create an installer for my project, with CPack and
> NSIS.
>
> The project is really really simple, I just need to copy over a directory
> somewhere.
> And I did something like:
>
> get_filename_component(**userprofile $ENV{USERPROFILE} REALPATH)
>
> install(
>  DIRECTORY ${EGG_BUILD_DIRECTORY}
>  DESTINATION ${userprofile}/${PROJECT_NAME}
>  )
>
>
> The first line is because CPack was exploding using the USERPROFILE,
> because
> it was getting non quoted backslash.
>
> So is it the way to handle windows path variables?
>
> The packing, however, doesn't work and I get something like (from the NSIS
> generated log file):
>
> !insertmacro: end of MUI_RESERVEFILE_INSTALLOPTIONS
> Section: "-Core installation"
> SetOutPath: "$INSTDIR"
> File: Returning to: "H:/long_path/_CPack_Packages/**win32/NSIS/Minimum
> Drag-0.1.1-win32"
> File: "H:/long_path/_CPack_Packages/**win32/NSIS/Minimum
> Drag-0.1.1-win32\*.*" -> no files found.
> Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
>   /oname=outfile one_file_only)
> Error in script "H:/git_projs/Minimum_Drag/**airbus.application.minimum_**
> drag/_CPack_Packages/win32/**NSIS/project.nsi" on line 640 -- aborting
> creation process
>
> These are the variables that I defined
> set(CPACK_NSIS_INSTALLED_ICON_**NAME "${PROJECT_NAME}")
> set(CPACK_PACKAGE_ICON "Company")
> set(CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME})
>
> set(CPACK_RESOURCE_FILE_**LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/**
> COPYRIGHT.txt")
> set(CPACK_PACKAGE_VERSION_**MAJOR 0)
> set(CPACK_PACKAGE_VERSION_**MINOR 1)
> set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}")
> set(CPACK_PACKAGE_INSTALL_**DIRECTORY "${PROJECT_NAME}") # add the
> version numbers
> set(CPACK_PACKAGE_DESCRIPTION "Package ${PROJECT_NAME}")
>
>
> is there anything missing?
> Any idea what that could be?
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120221/3b263614/attachment.htm>


More information about the CMake mailing list