From 5a45c05b9fb8ccaf9c87a4dd11ae4bbfac7c9615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 11 Jan 2022 13:10:54 -0300 Subject: [PATCH] Fix cmake and version variable in build system (#10109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * custom-example: Update from GIT_VERSION to new APP_VERSION_STR Signed-off-by: Patrick José Pereira * cmake: Fix usage of new variable APP_VERSION_STR over GIT_VERSION Signed-off-by: Patrick José Pereira --- CMakeLists.txt | 2 +- VideoReceiverApp/CMakeLists.txt | 2 +- cmake/Git.cmake | 2 +- cmake/QGCDeploy.cmake | 2 +- custom-example/custom.pri | 4 ++-- src/CMakeLists.txt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1102060baff..ab61117b465 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ add_definitions( ) include(Git) -message(STATUS "QGroundControl version: ${GIT_VERSION}") +message(STATUS "QGroundControl version: ${APP_VERSION_STR}") #============================================================================= # ccache diff --git a/VideoReceiverApp/CMakeLists.txt b/VideoReceiverApp/CMakeLists.txt index 2630a49f0ca..c3c0f72cd88 100644 --- a/VideoReceiverApp/CMakeLists.txt +++ b/VideoReceiverApp/CMakeLists.txt @@ -39,7 +39,7 @@ set(COPYRIGHT "Copyright (c) 2020 VideoReceiverApp. All rights reserved.") set(IDENTIFIER "labs.auterion.VideoReceiverApp") include(Git) -message(STATUS "VideoReceiverApp version: ${GIT_VERSION}") +message(STATUS "VideoReceiverApp version: ${APP_VERSION_STR}") #============================================================================= # ccache diff --git a/cmake/Git.cmake b/cmake/Git.cmake index 8dbebcde844..c26b1da2745 100644 --- a/cmake/Git.cmake +++ b/cmake/Git.cmake @@ -21,5 +21,5 @@ endif() # Fetch the necessary git variables execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_VERSION + OUTPUT_VARIABLE APP_VERSION_STR OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/cmake/QGCDeploy.cmake b/cmake/QGCDeploy.cmake index 162096691a4..3cc5b51c3d5 100644 --- a/cmake/QGCDeploy.cmake +++ b/cmake/QGCDeploy.cmake @@ -40,7 +40,7 @@ elseif(APPLE) COMMAND rsync -a --delete ${CMAKE_BINARY_DIR}/QGroundControl.app ${CMAKE_BINARY_DIR}/staging COMMAND - hdiutil create /tmp/tmp.dmg -ov -volname "QGroundControl-$${GIT_VERSION}" -fs HFS+ -srcfolder "staging" + hdiutil create /tmp/tmp.dmg -ov -volname "QGroundControl-$${APP_VERSION_STR}" -fs HFS+ -srcfolder "staging" COMMAND hdiutil convert /tmp/tmp.dmg -format UDBZ -o ${CMAKE_BINARY_DIR}/package/QGroundControl.dmg ) diff --git a/custom-example/custom.pri b/custom-example/custom.pri index cc233b283db..b55dd862803 100644 --- a/custom-example/custom.pri +++ b/custom-example/custom.pri @@ -17,8 +17,8 @@ win32 { } CUSTOM_QGC_VERSION = $${CUSTOM_QGC_VER_MAJOR}.$${CUSTOM_QGC_VER_MINOR}.$${CUSTOM_QGC_VER_BUILD} -DEFINES -= GIT_VERSION=\"\\\"$$GIT_VERSION\\\"\" -DEFINES += GIT_VERSION=\"\\\"$$CUSTOM_QGC_VERSION\\\"\" +DEFINES -= APP_VERSION_STR=\"\\\"$$APP_VERSION_STR\\\"\" +DEFINES += APP_VERSION_STR=\"\\\"$$CUSTOM_QGC_VERSION\\\"\" message(Custom QGC Version: $${CUSTOM_QGC_VERSION}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 64ecfedc1e8..cb7301c866a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -112,7 +112,7 @@ add_library(qgc TerrainTile.h ) -set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS GIT_VERSION="${GIT_VERSION}") +set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS APP_VERSION_STR="${APP_VERSION_STR}") add_subdirectory(ui)