[CMake] CPack/NSIS multiple component intall location

Romuald Delmont romualddelmont at gmail.com
Tue Apr 23 14:19:30 EDT 2013


Hi Erik

This is a simplified view of my project:

Root CMakeList:

PROJECT (Foo)

FOREACH( mysubdirs
  Apps
  Data
)

SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Foo")
SET(CPACK_NSIS_COMPONENT_INSTALL ON)
include(CPACK)


Apps CMakeList:

set(TARGET_NAME Apps)

# Build some stuff ...

install(TARGETS Apps
        RUNTIME DESTINATION Apps
)



Data CMakeList:

set(TARGET_NAME Data)

# Build some stuff to OUTPUT_FILES

install(FILES ${OUTPUT_FILES}
    DESTINATION Data
)


On Win7, Data should be on ProgramData\Foo and Apps should be on
ProgramFiles\Foo

Is there a way to set the install directory (as
CPACK_PACKAGE_INSTALL_DIRECTORY does) by component to achieve this.

I wish i can do this without breaking into
NSIS.template.in<http://nsis.template.in/>
.

Thanks


2013/4/23 Eric Noulard <eric.noulard at gmail.com>

> 2013/4/23 Romuald Delmont <romualddelmont at gmail.com>:
> > Hi All
> >
> > I'm packaging an application with CMake/Cpack/NSIS and it's going pretty
> > well except for one point.
> >
> > I have a core component with executables and a data component. Both are
> > built by CMake and have an INSTALL command.
> > Install target gives me 2 directories (Apps and Data) in the
> > CMAKE_INSTALL_PREFIX directory which is fine.
> >
> > With CPack/Nsis, I try to install them in 2 different locations like
> > ProgramFiles for Core and ProgramData for Data, but I cannot find a way
> to
> > do this.
>
> Do you mean that it works when building INSTALL target but it doesn't
> when building NSIS installer with CPack?
>
> Could you give us the **exact**
> install(TARGET ...)
>
> statement you use for each target.
>
> > Is there a way to specify an install destination by component?
>
> DESTINATTION is attached to an install(...) statement
> such as COMPONENT.
>
> If you have two different components then each of them
> should appear in separate install(...), each one having
> its DESTINATION argument as well.
>
> Dis you try to build a componentized ZIP and see what happen?
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130423/edb1e85b/attachment.htm>


More information about the CMake mailing list