Skip to content

Commit

Permalink
Merge remote-tracking branch 'DenisBiryukov91/fix-pacakge' into build…
Browse files Browse the repository at this point in the history
…-packages-cpack
  • Loading branch information
diogomatsubara committed Oct 28, 2024
2 parents 6b42455 + 357e907 commit 4cf029f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 11 additions & 2 deletions install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(install_zenohc_lib configurations property_postfix package_name)
get_target_property(staticlib_path zenohc::static IMPORTED_LOCATION_${property_postfix})
get_target_property(NATIVE_STATIC_LIBS zenohc::static INTERFACE_LINK_LIBRARIES)
get_filename_component(STATICLIB ${staticlib_path} NAME)
install(FILES ${staticlib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations} COMPONENT lib)
install(FILES ${staticlib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations} COMPONENT dev)

set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${package_name}")

Expand Down Expand Up @@ -98,7 +98,7 @@ 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")
set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - cmake files")
set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - zenoh-c static lib and cmake files")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - header files")
set(CPACK_COMPONENT_LIB_GROUP "lib")
set(CPACK_COMPONENT_HEADERS_GROUP "dev")
Expand All @@ -124,7 +124,16 @@ endif()

set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")

if(NOT DEBARCH)
set(DEBARCH ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME})
endif()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEBARCH})

if(NOT RPMARCH)
set(RPMARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${RPMARCH})

set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpack_project_config.cmake")

include(CPack)
6 changes: 0 additions & 6 deletions install/cpack_project_config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if(CPACK_GENERATOR MATCHES "DEB")
# DEB package
message(STATUS "Configure DEB packaging for Linux ${DEBARCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ZettaScale Zenoh Team, <[email protected]>")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
Expand All @@ -14,11 +13,6 @@ if(CPACK_GENERATOR MATCHES "RPM")
# RPM package
# rpmbuild should be installed
# apt install rpm
if(NOT RPMARCH)
set(RPMARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
message(STATUS "Configure RPM packaging for Linux ${RPMARCH}")
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${RPMARCH})
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_LIB_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) # avoid "-lib" suffix for "lib" package
Expand Down

0 comments on commit 4cf029f

Please sign in to comment.