On Tue, Nov 5, 2013 at 12:11 PM, Alexander Broekhuis <a.broekh...@gmail.com> wrote: > Hi all, > > I have a CMake project for which I want to generate a RPM and/or ZIP file. > But instead of including all components/groups I want to control this. > > I do know I can create a CPack configuration file to create a package for 1 > component using CPACK_INSTALL_CMAKE_PROJECTS, how can I do this for a > component_group? > > For example, I have a component group called "bundles", and also several > components (eg "a" and "b"). Both "a" and "b" are added to the group > "bundles". How can I now create one CPack configuration so that I have one > package containing all bundles? > > -- > Thanks in advance, > > Alexander Broekhuis >
The easiest way I know is to use CPACK_COMPONENTS_ALL, which is what I use to package subsets of my components. I don't currently use grouping, but if I would, I would create something like an add_component_to_group(compname, groupname) function, that you can call for every component when you first define it (or add a GROUP parameter it to my define_package_component() function). In addition to setting PACK_COMPONENT_${compname_uppercase}_GROUP to ${groupname}, it should append ${compname} to a (global) package_group_${groupname}_components list variable. Then populate the CPACK_COMPONENTS_ALL list by iterating over your list of required groups, and for each group name, append ${package_group_${groupname}_components}. Hope that gives you some ideas to start from, regards Mark -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake