Re: [CMake] CPack multiple packages

2018-07-19 Thread Domen Vrankar
2018-07-19 18:00 GMT+02:00 dbegun via CMake :

> I have a project where a lib and a binary requiring the lib are built in
> separate subdirs of the project root. Each dir contains its own
> CMakeLists.txt with build/install targets, and there is also a top level
> one, which mainly just adds subdirectories etc.
> I want to add .deb package generation with cpack. When I place the
> following in either of the inner CMakeLists, a package containing the
> binary is built.
>
> set(CPACK_BINARY_DEB "ON")
> set(CPACK_GENERATOR "DEB")
> set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
> set(CPACK_PACKAGE_VERSION ${PROJ_VERSION})
> set(CPACK_PACKAGE_CONTACT "Denis Begun dbegun@protonmail.
> com")
> set(CPACK_PACKAGE_DESCRIPTION "proj")
> set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
> include(CPack)
>
> If I place it in both inner lists, nothing changes. If I place it in the
> top level CMakeList.txt, nothing is generated. The problem is that the
> package doesn't contain the library, so the binary can't run after
> installation.
>
> What's the right direction to look in?
>

Have you tried placing the include(CPack) at the bottom of the top level
CMakeLists.txt after the rest of the CMakeLists.txt files have been
included?

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] CPack multiple packages

2018-07-19 Thread dbegun via CMake
I have a project where a lib and a binary requiring the lib are built in 
separate subdirs of the project root. Each dir contains its own CMakeLists.txt 
with build/install targets, and there is also a top level one, which mainly 
just adds subdirectories etc.
I want to add .deb package generation with cpack. When I place the following in 
either of the inner CMakeLists, a package containing the binary is built.

set(CPACK_BINARY_DEB "ON")
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJ_VERSION})
set(CPACK_PACKAGE_CONTACT "Denis Begun 
[dbegun@protonmail.](mailto:dbe...@allmonitoring.ru)com")
set(CPACK_PACKAGE_DESCRIPTION "proj")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
include(CPack)

If I place it in both inner lists, nothing changes. If I place it in the top 
level CMakeList.txt, nothing is generated. The problem is that the package 
doesn't contain the library, so the binary can't run after installation.

What's the right direction to look in?

Sent with [ProtonMail](https://protonmail.com) Secure Email.-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] cpack multiple packages

2017-01-05 Thread 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:domen.vran...@gmail.com]
Sent: Thursday, December 22, 2016 20:43
To: Dvir Yitzchaki <dvir.yitzch...@ceva-dsp.com>
Cc: Eric Noulard <eric.noul...@gmail.com>; cmake@cmake.org
Subject: Re: [CMake] cpack multiple packages

2016-12-21 12:29 GMT+01:00 Dvir Yitzchaki 
<dvir.yitzch...@ceva-dsp.com<mailto:dvir.yitzch...@ceva-dsp.com>>:
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

Re: [CMake] cpack multiple packages

2016-12-22 Thread Domen Vrankar
2016-12-21 12:29 GMT+01:00 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?
>

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

Re: [CMake] cpack multiple packages

2016-12-21 Thread 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:eric.noul...@gmail.com]
Sent: Wednesday, December 21, 2016 10:42 AM
To: Dvir Yitzchaki <dvir.yitzch...@ceva-dsp.com>
Cc: cmake@cmake.org
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:
https://cmake.org/cmake/help/v3.7/module/CPackComponent.html
https://cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging

2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki 
<dvir.yitzch...@ceva-dsp.com<mailto:dvir.yitzch...@ceva-dsp.com>>:
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<http://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

Re: [CMake] cpack multiple packages

2016-12-21 Thread 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:
https://cmake.org/cmake/help/v3.7/module/CPackComponent.html
https://cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging

2016-12-21 9:14 GMT+01:00 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
>



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

[CMake] cpack multiple packages

2016-12-21 Thread 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