From 357e9073213e20153c8e3fd52de73a49187baa12 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 28 Oct 2024 10:40:27 +0100 Subject: [PATCH] fix deb/rpm architecture; move static lib to dev package; --- install/CMakeLists.txt | 15 ++++++++++++--- install/cpack_project_config.cmake | 6 ------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 7278eb1db..130502314 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -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}") @@ -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") @@ -124,7 +124,16 @@ endif() set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") -set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${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) diff --git a/install/cpack_project_config.cmake b/install/cpack_project_config.cmake index 51c220aab..f762cb522 100644 --- a/install/cpack_project_config.cmake +++ b/install/cpack_project_config.cmake @@ -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, ") set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) @@ -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