Skip to content

Commit

Permalink
fix: align cmake deb/rpm with zenoh-c
Browse files Browse the repository at this point in the history
  • Loading branch information
diogomatsubara committed Oct 31, 2024
1 parent e7c9d80 commit dc3e905
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 10 additions & 0 deletions install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ if(NOT CPACK_PACKAGE_VERSION)
endif()
endif()

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_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpack_project_config.cmake")

Expand Down
12 changes: 0 additions & 12 deletions install/cpack_project_config.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
if(CPACK_GENERATOR MATCHES "DEB")
# DEB package
if(NOT DEBARCH)
execute_process(
COMMAND dpkg --print-architecture
OUTPUT_VARIABLE DEBARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
message(STATUS "Configure DEB packaging for Linux ${DEBARCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ZettaScale Zenoh Team, <zenoh@zettascale.tech>")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEBARCH})
set(CPACK_DEB_COMPONENT_INSTALL OFF)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_NAME lib${CPACK_PACKAGE_NAME}-dev)
Expand All @@ -23,8 +13,6 @@ if(CPACK_GENERATOR MATCHES "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 OFF)
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME}-dev)
Expand Down

0 comments on commit dc3e905

Please # to comment.