I have a cmake project consisting of a set of executable files, independent of each other with two shared libraries. I want to pack each executable file into a deb package. As a result, I get one deb package with all programs and libs.
part of the source code:
cmake_minimum_required (VERSION 3.12)
set (CPACK_GENERATOR "DEB")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "i am")
set (CPACK_DEB_COMPONENT_INSTALL 1)
include (CPack)
add_executable (module1 main.cpp)
install (TARGETS module1
RUNTIME DESTINATION bin
COMPONENT component1)
add_library (my_lib SHARED map.cpp templates.cpp)
add_executable (my_lib main.cpp utils.cpp)
target_link_libraries (module2 PUBLIC my_lib)
install(TARGETS module2 my_lib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
COMPONENT component2)
How to divide programs into different deb packages?