From ef35c0bd48978e6b7ce99a8aa31e39db87f16ba2 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 1 Oct 2014 17:11:28 +0000 Subject: [PATCH] Use correct svn revision in program name text The latest revision rather than the revision of the last change to the current working set was being used in the program name text as seen in the "About" window and reported to PSKReporter. Also removed a redundant old file. Merged from wsjtx-1.4 branch. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4424 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMake/getsvn.cmake | 14 +++++++------- getsvn.cmake | 16 ---------------- 2 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 getsvn.cmake diff --git a/CMake/getsvn.cmake b/CMake/getsvn.cmake index a06e84fa1..bf7e73f73 100644 --- a/CMake/getsvn.cmake +++ b/CMake/getsvn.cmake @@ -13,15 +13,15 @@ if (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn") REGEX "^[^?].*$" ) if (__svn_changes) - message (WARNING "Source tree based on revision ${MY_WC_REVISION} appears to have local changes") - set (MY_WC_REVISION "${MY_WC_REVISION}-dirty") + message (WARNING "Source tree based on revision ${MY_WC_LAST_CHANGED_REV} appears to have local changes") + set (MY_WC_LAST_CHANGED_REV "${MY_WC_LAST_CHANGED_REV}-dirty") foreach (__svn_change ${__svn_changes}) message (STATUS "${__svn_change}") endforeach (__svn_change ${__svn_changes}) endif (__svn_changes) - message (STATUS "${SOURCE_DIR} contains a .svn and is revision ${MY_WC_REVISION}") + message (STATUS "${SOURCE_DIR} contains a .svn and is revision ${MY_WC_LAST_CHANGED_REV}") # write a file with the SVNVERSION define - file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION ${MY_WC_REVISION}\n") + file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION ${MY_WC_LAST_CHANGED_REV}\n") else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn") # try git-svn if (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.git") @@ -39,11 +39,11 @@ else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn") REGEX "^diff-tree" ) if ((NOT ${__git_svn_status} EQUAL 0) OR __svn_changes) - message (WARNING "Source tree based on revision ${MY_WC_REVISION} appears to have local changes") - set (MY_WC_REVISION "${MY_WC_REVISION}-dirty") + message (WARNING "Source tree based on revision ${MY_WC_LAST_CHANGED_REV} appears to have local changes") + set (MY_WC_LAST_CHANGED_REV "${MY_WC_LAST_CHANGED_REV}-dirty") endif () # write a file with the SVNVERSION define - file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION r${MY_WC_REVISION}\n") + file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION r${MY_WC_LAST_CHANGED_REV}\n") else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn") file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION local\n") endif (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.git") diff --git a/getsvn.cmake b/getsvn.cmake deleted file mode 100644 index d1007b2c4..000000000 --- a/getsvn.cmake +++ /dev/null @@ -1,16 +0,0 @@ -find_package (Subversion) -if (Subversion_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.svn) - # the FindSubversion.cmake module is part of the standard distribution - include (FindSubversion) - # extract working copy information for SOURCE_DIR into MY_XXX variables - Subversion_WC_INFO (${SOURCE_DIR} MY) - # write a file with the SVNVERSION define - file (WRITE svnversion.h.txt "#define SVNVERSION ${MY_WC_REVISION}\n") -else (Subversion_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.svn) - file (WRITE svnversion.h.txt "#define SVNVERSION local\n") -endif (Subversion_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.svn) - -# copy the file to the final header only if the version changes -# reduces needless rebuilds -execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different - svnversion.h.txt svnversion.h)