forked from Archive/PX4-Autopilot
cmake: fix and update packaging
This commit is contained in:
parent
5eb13e4448
commit
2b5722786b
|
@ -9,10 +9,10 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
def build_nodes = [:]
|
def build_nodes = [:]
|
||||||
def docker_images = [
|
def docker_images = [
|
||||||
armhf: "px4io/px4-dev-armhf:2021-09-08",
|
armhf: "px4io/px4-dev-armhf:2022-08-12",
|
||||||
arm64: "px4io/px4-dev-aarch64:2021-09-08",
|
arm64: "px4io/px4-dev-aarch64:2022-08-12",
|
||||||
base: "px4io/px4-dev-base-bionic:2021-09-08",
|
base: "px4io/px4-dev-ros2-foxy:2022-08-12",
|
||||||
nuttx: "px4io/px4-dev-nuttx-focal:2021-09-08",
|
nuttx: "px4io/px4-dev-nuttx-focal:2022-08-12",
|
||||||
]
|
]
|
||||||
|
|
||||||
def armhf_builds = [
|
def armhf_builds = [
|
||||||
|
|
|
@ -118,7 +118,21 @@ execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
message(STATUS "PX4 version: ${PX4_GIT_TAG}")
|
|
||||||
|
# git describe to X.Y.Z version
|
||||||
|
string(REPLACE "." ";" VERSION_LIST ${PX4_GIT_TAG})
|
||||||
|
|
||||||
|
# major version
|
||||||
|
list(GET VERSION_LIST 0 PX4_VERSION_MAJOR)
|
||||||
|
string(REPLACE "v" "" PX4_VERSION_MAJOR ${PX4_VERSION_MAJOR})
|
||||||
|
# minor version
|
||||||
|
list(GET VERSION_LIST 1 PX4_VERSION_MINOR)
|
||||||
|
# patch version
|
||||||
|
list(GET VERSION_LIST 2 PX4_VERSION_PATCH)
|
||||||
|
string(REPLACE "-" ";" PX4_VERSION_PATCH ${PX4_VERSION_PATCH})
|
||||||
|
list(GET PX4_VERSION_PATCH 0 PX4_VERSION_PATCH)
|
||||||
|
|
||||||
|
message(STATUS "PX4 version: ${PX4_GIT_TAG} (${PX4_VERSION_MAJOR}.${PX4_VERSION_MINOR}.${PX4_VERSION_PATCH})")
|
||||||
|
|
||||||
define_property(GLOBAL PROPERTY PX4_MODULE_LIBRARIES
|
define_property(GLOBAL PROPERTY PX4_MODULE_LIBRARIES
|
||||||
BRIEF_DOCS "PX4 module libs"
|
BRIEF_DOCS "PX4 module libs"
|
||||||
|
@ -456,6 +470,9 @@ add_custom_command(OUTPUT ${uorb_graph_config}
|
||||||
add_custom_target(uorb_graph DEPENDS ${uorb_graph_config})
|
add_custom_target(uorb_graph DEPENDS ${uorb_graph_config})
|
||||||
|
|
||||||
|
|
||||||
|
include(bloaty)
|
||||||
|
|
||||||
|
|
||||||
include(doxygen)
|
include(doxygen)
|
||||||
include(metadata)
|
include(metadata)
|
||||||
include(package)
|
include(package)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
find_program(BLOATY_PROGRAM bloaty)
|
find_program(BLOATY_PROGRAM bloaty)
|
||||||
if (BLOATY_PROGRAM)
|
if(BLOATY_PROGRAM)
|
||||||
|
|
||||||
set(BLOATY_OPTS --demangle=full --domain=vm -s vm -n 200 -w)
|
set(BLOATY_OPTS --demangle=full --domain=vm -s vm -n 200 -w)
|
||||||
|
|
||||||
|
@ -78,13 +78,15 @@ if (BLOATY_PROGRAM)
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|
||||||
# bloaty compare with last master build
|
if(${PX4_PLATFORM} MATCHES "nuttx")
|
||||||
add_custom_target(bloaty_compare_master
|
# bloaty compare with last master build
|
||||||
COMMAND wget --continue --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf -O master.elf
|
add_custom_target(bloaty_compare_master
|
||||||
COMMAND ${BLOATY_PROGRAM} -d symbols ${BLOATY_OPTS} $<TARGET_FILE:px4> -- master.elf
|
COMMAND wget --continue --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf -O master.elf
|
||||||
DEPENDS px4
|
COMMAND ${BLOATY_PROGRAM} -d symbols ${BLOATY_OPTS} $<TARGET_FILE:px4> -- master.elf
|
||||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
DEPENDS px4
|
||||||
VERBATIM
|
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||||
USES_TERMINAL
|
VERBATIM
|
||||||
)
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -34,30 +34,67 @@
|
||||||
# packaging
|
# packaging
|
||||||
|
|
||||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${PX4_CONFIG})
|
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${PX4_CONFIG})
|
||||||
set(CPACK_PACKAGE_VERSION ${PX4_GIT_TAG})
|
|
||||||
set(CPACK_PACKAGE_CONTACT ${package-contact})
|
set(CPACK_PACKAGE_VENDOR "px4")
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # TODO: review packaging for linux boards
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
set(CPACK_PACKAGE_VERSION_MAJOR ${PX4_VERSION_MAJOR})
|
||||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
set(CPACK_PACKAGE_VERSION_MINOR ${PX4_VERSION_MINOR})
|
||||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "The PX4 Pro autopilot.")
|
set(CPACK_PACKAGE_VERSION_PATCH ${PX4_VERSION_PATCH})
|
||||||
|
#set(CPACK_PACKAGE_VERSION ${PX4_GIT_TAG})
|
||||||
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_CONFIG}-${PX4_GIT_TAG}")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_CONFIG}-${PX4_GIT_TAG}")
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_GIT_TAG}")
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_CONFIG}-${PX4_GIT_TAG}-src")
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_CONTACT "daniel@agar.ca")
|
||||||
|
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PX4_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_RESOURCE_FILE_README "${PX4_SOURCE_DIR}/README.md")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP)
|
||||||
|
# without this you won't be able to pack only specified component
|
||||||
|
set(CPACK_DEB_COMPONENT_INSTALL YES)
|
||||||
|
|
||||||
|
#set(CPACK_STRIP_FILES YES)
|
||||||
|
|
||||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||||
set(CPACK_PACKAGING_INSTALL_PREFIX "")
|
set(CPACK_PACKAGING_INSTALL_PREFIX "")
|
||||||
set(CPACK_SET_DESTDIR "OFF")
|
set(CPACK_SET_DESTDIR "OFF")
|
||||||
|
|
||||||
if ("${CMAKE_SYSTEM}" MATCHES "Linux")
|
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||||
set(CPACK_GENERATOR "TBZ2")
|
set(CPACK_GENERATOR "TBZ2")
|
||||||
|
|
||||||
find_program(DPKG_PROGRAM dpkg)
|
find_program(DPKG_PROGRAM dpkg)
|
||||||
if (EXISTS ${DPKG_PROGRAM})
|
if(EXISTS ${DPKG_PROGRAM})
|
||||||
list (APPEND CPACK_GENERATOR "DEB")
|
list(APPEND CPACK_GENERATOR "DEB")
|
||||||
|
|
||||||
|
set(CPACK_SET_DESTDIR true)
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX "/tmp")
|
||||||
|
|
||||||
|
execute_process(COMMAND ${DPKG_PROGRAM} --print-architecture OUTPUT_VARIABLE DEB_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
message("Architecture: " ${DEB_ARCHITECTURE})
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${DEB_ARCHITECTURE}")
|
||||||
|
|
||||||
|
set(CPACK_INSTALL_PREFIX @DEB_INSTALL_PREFIX@)
|
||||||
|
message ("==> CPACK_INSTALL_PREFIX = " ${CPACK_INSTALL_PREFIX})
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Daniel Agar <${CPACK_PACKAGE_CONTACT}>")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
||||||
|
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
||||||
|
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 autopilot")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
|
||||||
|
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
|
||||||
|
# autogenerate dependency information
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||||
|
set(CPACK_DEBIAN_COMPRESSION_TYPE xz)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(CPACK_GENERATOR "ZIP")
|
set(CPACK_GENERATOR "ZIP")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
if(${PX4_PLATFORM} MATCHES "nuttx")
|
|
||||||
include(bloaty)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -182,31 +182,11 @@ elseif("${PX4_BOARD}" MATCHES "sitl")
|
||||||
${PROJECT_NAME}/build/px4_sitl_default
|
${PROJECT_NAME}/build/px4_sitl_default
|
||||||
)
|
)
|
||||||
|
|
||||||
# sitl_gazebo-classic built plugins
|
# gazebo dirs
|
||||||
install(
|
install(
|
||||||
DIRECTORY
|
DIRECTORY
|
||||||
${PX4_BINARY_DIR}/build_gazebo-classic
|
${PROJECT_SOURCE_DIR}/Tools/simulation/gz/models
|
||||||
DESTINATION
|
${PROJECT_SOURCE_DIR}/Tools/simulation/gz/worlds
|
||||||
${PROJECT_NAME}/build/px4_sitl_default
|
|
||||||
FILES_MATCHING
|
|
||||||
PATTERN "CMakeFiles" EXCLUDE
|
|
||||||
PATTERN "*.so"
|
|
||||||
)
|
|
||||||
|
|
||||||
# sitl_gazebo-classic dirs
|
|
||||||
install(
|
|
||||||
DIRECTORY
|
|
||||||
${PROJECT_SOURCE_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models
|
|
||||||
${PROJECT_SOURCE_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds
|
|
||||||
DESTINATION
|
|
||||||
${PROJECT_NAME}/Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
|
||||||
)
|
|
||||||
|
|
||||||
# sitl_gazebo-classic files
|
|
||||||
install(
|
|
||||||
FILES
|
|
||||||
${PROJECT_SOURCE_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/CMakeLists.txt
|
|
||||||
${PROJECT_SOURCE_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/package.xml
|
|
||||||
DESTINATION
|
DESTINATION
|
||||||
${PROJECT_NAME}/Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
${PROJECT_NAME}/Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue