Better version identification.

An  ambiguity  existed  between  release  candidates  and  development
versions  as there  was no  definitive identification  for development
versions.

Added a  new version number  suffix of  '-devel' which appears  if the
release candidate number is missing  or zero in Versions.cmake and the
revision is not marked as a release version, also in Versions.cmake.

Also re-factored setting of version number suffiexes to a single place
in in CMake/VersionCompute.cmake.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4422 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2014-10-01 15:57:43 +00:00
parent 272aa2caae
commit ffa6305b98
5 changed files with 10 additions and 17 deletions

View File

@ -1,8 +1,11 @@
# Load version number components.
include (${wsjtx_SOURCE_DIR}/Versions.cmake)
include (${CMAKE_SOURCE_DIR}/Versions.cmake)
# Compute the full version string.
if (WSJTX_RC AND NOT WSJTX_VERSION_IS_RELEASE)
set (WSJTX_VERSION_PATCH ${WSJTX_VERSION_PATCH}-rc${WSJTX_RC})
elseif (NOT WSJTX_VERSION_IS_RELEASE)
set (WSJTX_VERSION_PATCH ${WSJTX_VERSION_PATCH}-devel)
endif (WSJTX_RC AND NOT WSJTX_VERSION_IS_RELEASE)
set (wsjtx_VERSION ${WSJTX_VERSION_MAJOR}.${WSJTX_VERSION_MINOR}.${WSJTX_VERSION_PATCH})
if (WSJTX_RC)
set (wsjtx_VERSION ${wsjtx_VERSION}-rc${WSJTX_RC})
endif ()

View File

@ -39,7 +39,7 @@ set (PROJECT_DESCRIPTION "${PROJECT_SUMMARY_DESCRIPTION}
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake/Modules)
include (${PROJECT_SOURCE_DIR}/CMake/VersionCompute.cmake)
message (STATUS "Building ${CMAKE_PROJECT_NAME}-${wsjtx_VERSION}")
# make sure that the default configuration is a RELEASE
if (NOT CMAKE_BUILD_TYPE)
@ -952,9 +952,6 @@ set (CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set (CPACK_PACKAGE_VERSION_MAJOR ${WSJTX_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${WSJTX_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${WSJTX_VERSION_PATCH})
if (WSJTX_RC)
set (CPACK_PACKAGE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}-rc${WSJTX_RC})
endif (WSJTX_RC)
if (WIN32)
set (CPACK_GENERATOR "NSIS")

View File

@ -2,8 +2,8 @@
set (WSJTX_VERSION_MAJOR 1)
set (WSJTX_VERSION_MINOR 5)
set (WSJTX_VERSION_PATCH 0)
set (WSJTX_RC 1)
set (WSJTX_VERSION_IS_RELEASE 0)
set (WSJTX_RC 0) # release candidate number, comment out or zero for development versions
set (WSJTX_VERSION_IS_RELEASE 0) # set to 1 for final release build
set (CONFIG_TEST_VERSION_MAJOR 0)
set (CONFIG_TEST_VERSION_MINOR 2)

View File

@ -76,11 +76,6 @@ QString program_title (QString const& revision)
{
#if defined (CMAKE_BUILD)
QString id {QCoreApplication::applicationName () + " v" WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)};
# if defined (WSJTX_RC)
id += "-rc" WSJTX_STRINGIZE (WSJTX_RC);
# endif
#else
QString id {"WSJT-X Not for Release"};
#endif

View File

@ -4,8 +4,6 @@
#define WSJTX_VERSION_MAJOR @WSJTX_VERSION_MAJOR@
#define WSJTX_VERSION_MINOR @WSJTX_VERSION_MINOR@
#define WSJTX_VERSION_PATCH @WSJTX_VERSION_PATCH@
#cmakedefine WSJTX_RC @WSJTX_RC@
#cmakedefine01 WSJTX_VERSION_IS_RELEASE
#define CONFIG_TEST_VERSION_MAJOR @CONFIG_TEST_VERSION_MAJOR@
#define CONFIG_TEST_VERSION_MINOR @CONFIG_TEST_VERSION_MINOR@