[CMake] Install multiple components using CPack

Alexander Broekhuis a.broekhuis at gmail.com
Wed Nov 13 03:05:19 EST 2013


Hi,


2013/11/11 Mark Stijnman <mark.stijnman at gmail.com>

> On Tue, Nov 5, 2013 at 12:11 PM, 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 now solved it using CPACK_INSTALL_CMAKE_PROJECTS and populating it with
all components to be installed. Not sure how CPACK_COMPONENTS_ALL is
different, but will take a look.

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


In my custom Macros I do more or less the same. I append all components to
a cached internal variable. Then later on I create the CPack configuration
with this information. I guess you mean the same when talking about a
global variable? Or is there a different more simpler way without using the
cache?

I use the following:
set(CPACK_INSTALL_CMAKE_PROJECTS)
foreach(component ${INSTALL_BUNDLES})
    list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;Apache
Celix;${component};/")
endforeach(component)
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;Apache
Celix;framework;/")

CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/templates/CPackConfig-Installation.in
CPackConfig-Installation.cmake @ONLY)



>


> Hope that gives you some ideas to start from,
>

Yes it dit, it also gave me the idea that my solution is in the right
direction and that CMake/CPack doesn't support groups in its configuration.
Thanks!


>
> regards Mark
>



-- 
Met vriendelijke groet,

Alexander Broekhuis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131113/48bf00e4/attachment-0001.htm>


More information about the CMake mailing list