View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010130CMakeCPackpublic2010-01-12 17:512010-08-31 16:37
ReporterClinton Stimpson 
Assigned ToEric NOULARD 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionCMake-2-8 
Summary0010130: cpack components for non-component generators
DescriptionI would like to be able to choose what components to include in a package, even when a non-component based generator is used.

So, if I make a .zip or .tar.gz file, I want to be able to choose that a Runtime and Help component get included in there, when a Development component is not.

And I want the way of specifying that to work across all generators.
I can already customize how those components show up in the NSIS installer, with extra variables.
TagsNo tags attached.
Attached Files

related to 0010736closedEric NOULARD Enable CPack generators to produce more than one package 
related to 0009900closedEric NOULARD Make CPack generic generator delegate the name of the file to specific generator 

Clinton Stimpson (developer)
2010-08-02 19:44

Let me clarify.

This is basically asking that CPACK_COMPONENTS_ALL work for all cpack generators, and not just NSIS and PackageMaker.

This is to allow control of component packaging with the cpack config, while not having to write more complicated cmake code like this:
  install(... COMPONENT Runtime
          ... COMPONENT Development)
  install(... COMPONENT Runtime)
Eric NOULARD (developer)
2010-08-04 10:22

Have a look at latest 10736 patchset.
Now for every CPack Archive Generators, the default behavior
is to build 1 archive file per component group (found in the CPACK_COMPONENTS_ALL list)

If you want 1 archive file per component then specify

If you want all-in-one archive then specify

Does all those combination suits your needs?
Clinton Stimpson (developer)
2010-08-04 12:43

I like that it is respecting components I've chosen to package. That lets me create different packages for different customers.

But with the CPACK_MONOLITHIC_INSTALL option, its creating a .tar.gz package with
a directory structure divided up by components. I don't want that.

I want a

Eric NOULARD (developer)
2010-08-04 12:49


What is your platform?
On my Linux box if I do

mkdir Build
cd Build
cmake -DCPACK_MONOLITHIC_INSTALL=1 <path>/to/Source

cpack -G TGZ

I end up with no "component name" inside ?

Would you retry from a fresh build tree?
Clinton Stimpson (developer)
2010-08-04 13:12

I just edited the CPackConfig.cmake of an existing project and ran the new cpack on it.

From a new test project
file(WRITE "hi")

configure_file( ${CMAKE_CURRENT_BINARY_DIR}/file-runtime.txt)
configure_file( ${CMAKE_CURRENT_BINARY_DIR}/file-devel.txt)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/file-runtime.txt
        DESTINATION bin COMPONENT Runtime)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/file-devel.txt
        DESTINATION lib COMPONENT Development)

I get this warning when doing an include(CPack)
CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.

When I look at the CPackConfig.cmake, CPACK_COMPONENTS_ALL is missing, so I've lost control over which components to package.
If I edit the CPackConfig.cmake and put CPACK_COMPONENTS_ALL in it, then I get the behavior I was telling you before.
Eric NOULARD (developer)
2010-08-04 13:45

Ok right,

I understand now.

CPACK_MONOLITHIC_INSTALL basically ignore components
whereas CPACK_COMPONENTS_ALL describe the components
you want to install.

What you want is to have a **single** package containing
all components listed in CPACK_COMPONENTS_ALL.

The feature you want is more like having

This options would only makes sense for
"natively multiple files" CPack generator
like Archive Generator or RPM, DEB etc...

may be for the next patch :-)
The current implementation (of the Archive Generator)
does not enable that behavior.
But off course ... it could be implemented.
Eric NOULARD (developer)
2010-08-21 08:27

Hi Clint,

I think my last update for component support in Archive Generators
should fulfills all your needs.
see sibling bug: [^]
Eric NOULARD (developer)
2010-08-31 16:37

commit 65fa0f02351e1564d60b266594b425094dce1959
The following merge to master should fix the problem:

Merge: f95074b a986daf
Author: Brad King <>
Date: Tue Aug 31 14:24:32 2010 -0400

    Merge topic 'CPackArchiveGenerator-ComponentSupport'
    a986daf CPack fix broken compilation for CygwinSource generator
    873e99a CPackArchiveGenerator improve usability and robustness
    654683a CPackArchiveGenerator add component supports
    36a550a CPackArchiveGenerator use cmArchiveWrite wrapper

 Issue History
Date Modified Username Field Change
2010-01-12 17:51 Clinton Stimpson New Issue
2010-08-02 19:03 Eric NOULARD Relationship added related to 0010736
2010-08-02 19:04 Eric NOULARD Relationship added related to 0009900
2010-08-02 19:44 Clinton Stimpson Note Added: 0021600
2010-08-04 10:22 Eric NOULARD Note Added: 0021635
2010-08-04 12:43 Clinton Stimpson Note Added: 0021642
2010-08-04 12:49 Eric NOULARD Note Added: 0021643
2010-08-04 13:12 Clinton Stimpson Note Added: 0021646
2010-08-04 13:45 Eric NOULARD Note Added: 0021647
2010-08-21 08:25 Eric NOULARD Status new => assigned
2010-08-21 08:25 Eric NOULARD Assigned To => Eric NOULARD
2010-08-21 08:27 Eric NOULARD Note Added: 0021870
2010-08-31 16:37 Eric NOULARD Note Added: 0022036
2010-08-31 16:37 Eric NOULARD Status assigned => closed
2010-08-31 16:37 Eric NOULARD Resolution open => fixed
2010-08-31 16:37 Eric NOULARD Fixed in Version => CMake-2-8

Copyright © 2000 - 2018 MantisBT Team