Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix package generation #751

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ install(TARGETS ${Libname}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
COMPONENT Library
LIBRARY COMPONENT Runtime
ARCHIVE COMPONENT Runtime
RUNTIME COMPONENT Runtime
)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh-pico.h
DESTINATION include
Expand Down Expand Up @@ -373,17 +375,18 @@ install(
"${CMAKE_CURRENT_BINARY_DIR}/zenohpicoConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
CONFIGURATIONS ${configurations}
COMPONENT dev)
COMPONENT Dev)

# Generate <Package>Targets.cmake
install(
EXPORT zenohpicoTargets
NAMESPACE zenohpico::
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}")
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT Dev)

if(UNIX)
configure_file("${CMAKE_SOURCE_DIR}/zenohpico.pc.in" "${CMAKE_SOURCE_DIR}/zenohpico.pc" @ONLY)
install(FILES "${CMAKE_SOURCE_DIR}/zenohpico.pc" CONFIGURATIONS Release RelWithDebInfo DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(FILES "${CMAKE_SOURCE_DIR}/zenohpico.pc" CONFIGURATIONS Release RelWithDebInfo DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT Dev)
endif()

if(BUILD_EXAMPLES)
Expand Down Expand Up @@ -501,22 +504,25 @@ endif()
if(PACKAGING)
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")

set(CPACK_COMPONENTS_ALL Library Headers)
set(CPACK_COMPONENT_LIBRARY_GROUP "lib")
set(CPACK_COMPONENTS_ALL Runtime Headers Dev)

set(CPACK_COMPONENT_RUNTIME_GROUP "lib")
set(CPACK_COMPONENT_HEADERS_GROUP "dev")
set(CPACK_COMPONENT_HEADERS_DEPENDS Library)
set(CPACK_COMPONENT_DEV_GROUP "dev")
set(CPACK_COMPONENT_HEADERS_DEPENDS Runtime)
set(CPACK_COMPONENT_DEV_DEPENDS Runtime)

set(CPACK_PACKAGE_CHECKSUM MD5)
set(CPACK_PACKAGE_VENDOR "The Eclipse Foundation")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_COMPONENT_LIB_DESCRIPTION "The C client library for Eclipse zenoh targeting pico devices")
set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - devel files")
set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "The C client library for Eclipse zenoh targeting pico devices")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - headers")
set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - config files")

# Sources package
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES "/.git/;/.github/;/build/;/crossbuilds/")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-src-${PROJECT_VERSION}")

if(PACKAGING MATCHES "DEB")
Expand Down
2 changes: 1 addition & 1 deletion zenohpico.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ prefix=/usr/local
Name: zenohpico
Description:
URL:
Version: 1.0.20241017dev
Version: 1.0.20241018dev
Cflags: -I${prefix}/include
Libs: -L${prefix}/lib -lzenohpico
Loading