cpack multiple packages

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cpack multiple packages

Dvir Yitzchaki

Hi.

 

I have a big project which produces several zip packages.

Some files are common to all packages while others are unique per package.

 

Is there a way to create these packages using cpack?

 

I tried to use components but it seems that either it puts all components in one package or makes one package per component.

 

Thanks,

 

Dvir


--

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://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cpack multiple packages

Eric Noulard
When playing with component you have 3 major way to package which are governed by the value
of CPACK_COMPONENTS_GROUPING:


1 package per component -> set(CPACK_COMPONENTS_GROUPING IGNORE)
1 package for all -> set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
1 package per component group the default behavior.

In order to get 1 package per group you have to specify group when specifying component, more information
here:

2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki <[hidden email]>:

Hi.

 

I have a big project which produces several zip packages.

Some files are common to all packages while others are unique per package.

 

Is there a way to create these packages using cpack?

 

I tried to use components but it seems that either it puts all components in one package or makes one package per component.

 

Thanks,

 

Dvir


--

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://public.kitware.com/mailman/listinfo/cmake



--
Eric

--

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://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cpack multiple packages

Dvir Yitzchaki

Thanks, but as I understand a component can only belong to one group.

How can I get the same component/target on multiple packages?

 

From: Eric Noulard [mailto:[hidden email]]
Sent: Wednesday, December 21, 2016 10:42 AM
To: Dvir Yitzchaki <[hidden email]>
Cc: [hidden email]
Subject: Re: [CMake] cpack multiple packages

 

When playing with component you have 3 major way to package which are governed by the value

of CPACK_COMPONENTS_GROUPING:

 

 

1 package per component -> set(CPACK_COMPONENTS_GROUPING IGNORE)

1 package for all -> set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)

1 package per component group the default behavior.

 

In order to get 1 package per group you have to specify group when specifying component, more information

here:

 

2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki <[hidden email]>:

Hi.

 

I have a big project which produces several zip packages.

Some files are common to all packages while others are unique per package.

 

Is there a way to create these packages using cpack?

 

I tried to use components but it seems that either it puts all components in one package or makes one package per component.

 

Thanks,

 

Dvir


--

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://public.kitware.com/mailman/listinfo/cmake



 

--

Eric


--

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://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cpack multiple packages

Domen Vrankar
2016-12-21 12:29 GMT+01:00 Dvir Yitzchaki <[hidden email]>:

Thanks, but as I understand a component can only belong to one group.

How can I get the same component/target on multiple packages?


Usually you wouldn't want to package same file on same location with same filename since during unpackaging they would override each other so this is not supported out of the box.

Usually in such cases I would split packages even further so that one package would be base package of others (but automatic dependency tracking between them would require something more sophisticated than zip - RPM, Deb or some other CPack supported packager perhaps).

However if you really need to do something like that you could write a function that you would call instead of install(...) command which would just forward to it and the first parameter would have a list of components to which the file should belong. For e.g. some pseudo code:

function(my_install my_list other_params_that_get_forwarded...)
    foreach(component_name_ IN LISTS my_list)
        install(other_params_that_get_forwarded... COMPONENT ${component_name_})
    endforeach()
endfunction()

my_install("first;second;and_anotherone" "TARGETS target_name" "DESTINATION some_dir")

Hope this helps.

Regards,
Domen

--

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://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cpack multiple packages

Dvir Yitzchaki

Hi Domen.

 

That works perfectly. This is my code if anyone’s interested:

 

function(install_common)

    foreach(component ${ALL_COMPONENTS})         

         install(${ARGV} COMPONENT ${component})

    endforeach()

endfunction()

 

where ALL_COMPONENTS is a global variable holding all components.

 

Thanks,

Dvir

 

From: Domen Vrankar [mailto:[hidden email]]
Sent: Thursday, December 22, 2016 20:43
To: Dvir Yitzchaki <[hidden email]>
Cc: Eric Noulard <[hidden email]>; [hidden email]
Subject: Re: [CMake] cpack multiple packages

 

2016-12-21 12:29 GMT+01:00 Dvir Yitzchaki <[hidden email]>:

Thanks, but as I understand a component can only belong to one group.

How can I get the same component/target on multiple packages?

 

Usually you wouldn't want to package same file on same location with same filename since during unpackaging they would override each other so this is not supported out of the box.

Usually in such cases I would split packages even further so that one package would be base package of others (but automatic dependency tracking between them would require something more sophisticated than zip - RPM, Deb or some other CPack supported packager perhaps).

However if you really need to do something like that you could write a function that you would call instead of install(...) command which would just forward to it and the first parameter would have a list of components to which the file should belong. For e.g. some pseudo code:

function(my_install my_list other_params_that_get_forwarded...)

    foreach(component_name_ IN LISTS my_list)

        install(other_params_that_get_forwarded... COMPONENT ${component_name_})

    endforeach()

endfunction()

 

my_install("first;second;and_anotherone" "TARGETS target_name" "DESTINATION some_dir")

Hope this helps.

Regards,

Domen


--

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://public.kitware.com/mailman/listinfo/cmake