From 50159cabbe5e961e9ff52c6b9456b0db73d5b688 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 12 Jan 2017 18:11:02 -0500 Subject: [PATCH] Automatically set cmake version. --- CMakeLists.txt | 11 +++++++---- Makefile | 8 +++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 323d4ff06a..67f83f56da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,17 +242,20 @@ if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0) cmake_policy(SET CMP0054 NEW) # don't dereference quoted variables endif() +# version info from git +execute_process( + COMMAND Tools/tag_to_version.py ${PX4_SOURCE_DIR} + OUTPUT_VARIABLE version + WORKING_DIRECTORY ${PX4_SOURCE_DIR} + ) execute_process( COMMAND git describe --always --tags OUTPUT_VARIABLE git_tag OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${PX4_SOURCE_DIR} ) -set(version_major 1) -set(version_minor 5) -set(version_patch 0) -set(version "${version_major}.${version_minor}.${version_patch}") set(package-contact "px4users@googlegroups.com") +message(STATUS "PX4 VERSION: ${version}") #============================================================================= # find programs and packages diff --git a/Makefile b/Makefile index 04f415999b..f766e79cd5 100644 --- a/Makefile +++ b/Makefile @@ -260,11 +260,9 @@ format: check_%: @echo $(call colorecho,"Building" $(subst check_,,$@)) - @$(MAKE) --no-print-directory $(subst check_,,$@) - @mkdir -p Binaries - @mkdir -p Meta/$(subst check_,,$@) - @cp build_$(subst check_,,$@)/*.xml Meta/$(subst check_,,$@) 2> /dev/null || : - @find build_$(subst check_,,$@)/src/firmware -type f -name 'nuttx-*-default.px4' -exec cp "{}" Binaries \; 2> /dev/null || : + @$(MAKE) --no-print-directory $(subst check_,,$@) package + @mkdir -p Packages + @cp build_$(subst check_,,$@)/*.zip Packages @rm -rf build_$(subst check_,,$@) @echo