Skip to content

Commit

Permalink
Fix cmake and version variable in build system (#10109)
Browse files Browse the repository at this point in the history
* custom-example: Update from GIT_VERSION to new APP_VERSION_STR

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>

* cmake: Fix usage of new variable APP_VERSION_STR over GIT_VERSION

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Jan 11, 2022
1 parent 007a857 commit 5a45c05
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ add_definitions(
)

include(Git)
message(STATUS "QGroundControl version: ${GIT_VERSION}")
message(STATUS "QGroundControl version: ${APP_VERSION_STR}")

#=============================================================================
# ccache
Expand Down
2 changes: 1 addition & 1 deletion VideoReceiverApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/Git.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion cmake/QGCDeploy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 2 additions & 2 deletions custom-example/custom.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5a45c05

Please sign in to comment.