From 08a3b9df0c038c4bc4f05430fd474e97ad6c5eba Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 8 Mar 2022 18:35:33 +0100 Subject: [PATCH 1/6] [rootx] Remove "core developers" from splash window: We do not show this anymore, and this requires complex operations and - in its current implementation - a working ROOT build as part of the version update. --- build/unix/coreteam.sh | 23 ----------------------- rootx/src/rootcoreteam.h | 38 -------------------------------------- rootx/src/rootxx-cocoa.mm | 25 +------------------------ rootx/src/rootxx.cxx | 4 ---- 4 files changed, 1 insertion(+), 89 deletions(-) delete mode 100755 build/unix/coreteam.sh delete mode 100644 rootx/src/rootcoreteam.h diff --git a/build/unix/coreteam.sh b/build/unix/coreteam.sh deleted file mode 100755 index 393232ec90f52..0000000000000 --- a/build/unix/coreteam.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -AUTHORS="\n$(git shortlog -ns | head -n20 | cut -f2 | sed -e 's/^/ "/; s/$/",/;')\n 0\n" - -cat >| ${1:-rootcoreteam.h} <<-EOF -#ifndef ROOT_ROOTCoreTeam -#define ROOT_ROOTCoreTeam - -// This file is automatically generated with names from "git shortlog". -// with a terminating 0 - that is what our rootxx.cxx and rootx-cocoa.mm expect. -// Do not modify this file directly but run "make version" or -// "build/unix/coreteam.sh". - -namespace ROOT { -namespace ROOTX { - -const char *gROOTCoreTeam[] = {$(echo "$AUTHORS") }; - -} // namespace ROOTX -} // namespace ROOT - -#endif -EOF diff --git a/rootx/src/rootcoreteam.h b/rootx/src/rootcoreteam.h deleted file mode 100644 index 233665579065d..0000000000000 --- a/rootx/src/rootcoreteam.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ROOT_ROOTCoreTeam -#define ROOT_ROOTCoreTeam - -// This file is automatically generated with names from "git shortlog". -// with a terminating 0 - that is what our rootxx.cxx and rootx-cocoa.mm expect. -// Do not modify this file directly but run "make version" or -// "build/unix/coreteam.sh". - -namespace ROOT { -namespace ROOTX { - -const char *gROOTCoreTeam[] = { - "Rene Brun", - "Fons Rademakers", - "Philippe Canal", - "Axel Naumann", - "Olivier Couet", - "Sergey Linev", - "Lorenzo Moneta", - "Vassil Vassilev", - "Danilo Piparo", - "Enrico Guiraud", - "Bertrand Bellenot", - "Gerardo Ganis", - "Guilherme Amadio", - "Jakob Blomer", - "Wouter Verkerke", - "Pere Mato Vila", - "Jonas Rembser", - "Timur Pocheptsov", - "Stephan Hageboeck", - "Matevz Tadel", - 0 }; - -} // namespace ROOTX -} // namespace ROOT - -#endif diff --git a/rootx/src/rootxx-cocoa.mm b/rootx/src/rootxx-cocoa.mm index 60bc4ebcac306..870be00ae0e8d 100644 --- a/rootx/src/rootxx-cocoa.mm +++ b/rootx/src/rootxx-cocoa.mm @@ -32,8 +32,6 @@ #include "RConfigure.h" #include "RVersion.h" -#include "rootcoreteam.h" - namespace { #ifdef MAC_OS_X_VERSION_10_12 const NSCompositingOperation kCompositeSourceOver = NSCompositingOperationSourceOver; @@ -867,7 +865,7 @@ void SetSplashscreenPosition() //Aux. "non-GUI" functions. // -//Caption like "Conception"/"Core Developers"/"Contributors" - white and bold. +// Caption like "Conception"/"Contributors" - white and bold. // //_________________________________________________________________ @@ -997,27 +995,6 @@ bool AddDeveloperInfo(NSMutableAttributedString *textToScroll) //TODO: diagnostic. return false; - if (!AddSectionTitle(textToScroll, @"Core Engineering: ")) - //TODO: diagnostic. - return false; - - std::size_t nLines = sizeof ROOT::ROOTX::gROOTCoreTeam / sizeof ROOT::ROOTX::gROOTCoreTeam[0]; - if (nLines > 1) { - nLines -= 1;//There is a "terminating null" in this array, get rid of it. - - NSScopeGuard coreTeam([[NSMutableString alloc] init]); - - for (std::size_t i = 0; i < nLines; ++i) - [coreTeam.Get() appendFormat : (i ? @", %s" : @"%s"), ROOT::ROOTX::gROOTCoreTeam[i]]; - [coreTeam.Get() appendFormat : @".\n\n"]; - - if (!AddSectionBody(textToScroll, coreTeam.Get())) - return false; - } else { - //TODO: diagnostic. - return false; - } - return true; } diff --git a/rootx/src/rootxx.cxx b/rootx/src/rootxx.cxx index d05bc6ee57c85..6ec0b07aaa63a 100644 --- a/rootx/src/rootxx.cxx +++ b/rootx/src/rootxx.cxx @@ -32,8 +32,6 @@ #include "snprintf.h" #include "strlcpy.h" -#include "rootcoreteam.h" - #if defined(R__AIX) || defined(R__SOLARIS) # include #endif @@ -767,8 +765,6 @@ int DrawCredits(bool draw, bool extended) y = DrawCreditItem("Conception: ", gConception, y, draw); y += 2 * lineSpacing; - y = DrawCreditItem("Core Engineering: ", ROOT::ROOTX::gROOTCoreTeam, y, draw); - if (extended && gContributors) { y += 2 * lineSpacing; y = DrawCreditItem("Contributors: ", (const char **)gContributors, y, draw); From 82b9e2856f5df44f4e9b071e990a209d9d36756c Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Wed, 6 Sep 2023 17:37:51 +0200 Subject: [PATCH 2/6] [core,cmake,build] Define ROOT version in header: This simplifies the release procedure: no more bootstrapping, no more running of scripts; the source is the source. Given that the source now has the authoritative version number for releases (unlike for dev branches, of course) the ROOT package version is now determined from that header, rather than git describe which is less reliable. The updated release procedure will appear at https://root.cern/for_developers/release_checklist/ --- CMakeLists.txt | 37 ++++++++++------ build/unix/makeversion.py | 64 --------------------------- build/version_number | 1 - cmake/modules/RootMacros.cmake | 2 +- core/foundation/inc/ROOT/RVersion.hxx | 32 ++++++++++++++ core/foundation/inc/RVersion.h | 19 +------- 6 files changed, 58 insertions(+), 97 deletions(-) delete mode 100755 build/unix/makeversion.py delete mode 100644 build/version_number create mode 100644 core/foundation/inc/ROOT/RVersion.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 583a5213c6b33..42f81cbfec2c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,26 +86,34 @@ else() endif() function(SET_VERSION_FROM_FILE) - file(READ ${CMAKE_SOURCE_DIR}/build/version_number versionstr) - string(STRIP ${versionstr} versionstr) - string(REGEX REPLACE "([0-9]+)[.][0-9]+[/][0-9]+" "\\1" ROOT_MAJOR_VERSION ${versionstr}) - string(REGEX REPLACE "[0-9]+[.]([0-9]+)[/][0-9]+" "\\1" ROOT_MINOR_VERSION ${versionstr}) - string(REGEX REPLACE "[0-9]+[.][0-9]+[/]([0-9]+)" "\\1" ROOT_PATCH_VERSION ${versionstr}) - set(ROOT_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}" PARENT_SCOPE) + # See https://stackoverflow.com/questions/47066115/cmake-get-version-from-multiline-text-file + file(READ "${CMAKE_SOURCE_DIR}/core/foundation/inc/ROOT/RVersion.hxx" versionstr) + string(REGEX MATCH "#define ROOT_VERSION_MAJOR ([0-9]*)" _ ${versionstr}) + set(ROOT_MAJOR_VERSION ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define ROOT_VERSION_MINOR ([0-9]*)" _ ${versionstr}) + set(ROOT_MINOR_VERSION ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define ROOT_VERSION_PATCH ([0-9]*)" _ ${versionstr}) + set(ROOT_PATCH_VERSION ${CMAKE_MATCH_1}) + set(ROOT_MAJOR_VERSION "${ROOT_MAJOR_VERSION}" PARENT_SCOPE) set(ROOT_MINOR_VERSION "${ROOT_MINOR_VERSION}" PARENT_SCOPE) set(ROOT_PATCH_VERSION "${ROOT_PATCH_VERSION}" PARENT_SCOPE) endfunction() -if(GIT_DESCRIBE_ERRCODE) - SET_VERSION_FROM_FILE() -else() +SET_VERSION_FROM_FILE() + +set(ROOT_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}") +set(ROOT_FULL_VERSION "${ROOT_VERSION}") + +math(EXPR ROOT_PATCH_VERSION_ODD ${ROOT_PATCH_VERSION}%2) +# For release versions (even patch version number) we use the number from +# core/foundation/inc/ROOT/RVersion.hxx, not that of git: it's more stable / reliable. +if(NOT GIT_DESCRIBE_ERRCODE AND ${ROOT_PATCH_VERSION_ODD} EQUAL 1) execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git describe --always OUTPUT_VARIABLE GIT_DESCRIBE_ALWAYS ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) string(TIMESTAMP GIT_TIMESTAMP "%b %d %Y, %H:%M:%S" UTC) - string(REGEX REPLACE "^v([0-9]+)-([0-9]+)-(.*)" "\\1.\\2.\\3" ROOT_FULL_VERSION ${GIT_DESCRIBE_ALWAYS}) if("${GIT_DESCRIBE_ALL}" MATCHES "^tags/v[0-9]+-[0-9]+-[0-9]+.*") # GIT_DESCRIBE_ALWAYS: v6-16-00-rc1 @@ -114,6 +122,7 @@ else() string(REGEX REPLACE "^tags/v([0-9]+)-.*" "\\1" ROOT_MAJOR_VERSION ${GIT_DESCRIBE_ALL}) string(REGEX REPLACE "^tags/v[0-9]+-([0-9]+).*" "\\1" ROOT_MINOR_VERSION ${GIT_DESCRIBE_ALL}) string(REGEX REPLACE "^tags/v[0-9]+-[0-9]+-([0-9]+).*" "\\1" ROOT_PATCH_VERSION ${GIT_DESCRIBE_ALL}) + string(REGEX REPLACE "^v([0-9]+)-([0-9]+)-(.*)" "\\1.\\2.\\3" ROOT_FULL_VERSION ${GIT_DESCRIBE_ALWAYS}) elseif("${GIT_DESCRIBE_ALL}" MATCHES "/v[0-9]+-[0-9]+.*-patches$") # GIT_DESCRIBE_ALWAYS: v6-16-00-rc1-47-g9ba56ef4a3 # GIT_DESCRIBE_ALL: heads/v6-16-00-patches @@ -123,13 +132,13 @@ else() else() # GIT_DESCRIBE_ALWAYS: v6-13-04-2163-g7e8d27ea66 # GIT_DESCRIBE_ALL: heads/master or remotes/origin/master - SET_VERSION_FROM_FILE() - set(ROOT_FULL_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}") + + # Use what was set above in SET_VERSION_FROM_FILE(). endif() - set(ROOT_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}") - message(STATUS "Detected ROOT_VERSION ${ROOT_VERSION}") endif() +message(STATUS "Building ROOT version ${ROOT_FULL_VERSION}") + #---Try to download a file to check internet connection----------------------------------------- message(STATUS "Checking internet connectivity") file(DOWNLOAD https://root.cern/files/cmake_connectivity_test.txt ${CMAKE_CURRENT_BINARY_DIR}/cmake_connectivity_test.txt diff --git a/build/unix/makeversion.py b/build/unix/makeversion.py deleted file mode 100755 index a4b3cc5ff90d8..0000000000000 --- a/build/unix/makeversion.py +++ /dev/null @@ -1,64 +0,0 @@ -# Script to update base/inc/RVersion.h. -# Called by main Makefile as soon as build/version_number has been updated. -# -# Author: Axel, 2020-03-06 - -import os, subprocess, re -from datetime import date, datetime - -versionline = "" -with open("build/version_number", "r") as file: - versionline = file.read().replace('\n', '') - -matches = re.match(r'^(\d+)[.](\d+)/(\d+)$', versionline).groups() -if len(matches) != 3: - raise RuntimeError("build/version_number: invalid syntax") - -major = int(matches[0]) -minor = int(matches[1]) -patch = int(matches[2]) -vers_code = (major << 16) + (minor << 8) + patch - -datenow = date.today().strftime("%b %d %Y") # Sep 11 2019 -timenow = datetime.now().strftime("%H:%M:%S") # 15:05:55 - -sourcecode = """#ifndef ROOT_RVersion -#define ROOT_RVersion - -/* Version information automatically generated by installer. */ - -/* - * These macros can be used in the following way: - * - * #if ROOT_VERSION_CODE >= ROOT_VERSION(6,32,4) - * #include - * #else - * #include - * #endif - * -*/ - -#define ROOT_RELEASE "{}" -#define ROOT_RELEASE_DATE "{}" -#define ROOT_RELEASE_TIME "{}" -#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define ROOT_VERSION_CODE ROOT_VERSION({},{},{}) /* {} */ - -#endif -""".format(versionline, datenow, timenow, major, minor, patch, vers_code) - -with open('core/foundation/inc/RVersion.h', 'w') as file: - file.write(sourcecode) - -subprocess.check_call("build/unix/coreteam.sh rootx/src/rootcoreteam.h", shell = True) - -print("Committing changes.") -subprocess.check_call(['git', 'commit', - 'core/foundation/inc/RVersion.h', 'rootx/src/rootcoreteam.h', - 'build/version_number', 'documentation/doxygen/Doxyfile', - '-m', '"Update ROOT version files to v{}."'.format(versionline)]) - -print(""" -New version is {}. -See https://root.cern/release-checklist for the next steps, -for instance tagging if this is a release.""".format(versionline)) diff --git a/build/version_number b/build/version_number deleted file mode 100644 index 3bbdfca4020aa..0000000000000 --- a/build/version_number +++ /dev/null @@ -1 +0,0 @@ -6.29/01 diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index f568be154b2c3..de66c2d785c5c 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -782,7 +782,7 @@ function (ROOT_CXXMODULES_APPEND_TO_MODULEMAP library library_headers) list(APPEND found_headers "${dir_headers}") endforeach() - set(excluded_headers RConfig.h RVersion.h RtypesImp.h + set(excluded_headers RConfig.h RVersion.h core/foundation/inc/ROOT/RVersion.hxx RtypesImp.h RtypesCore.h TClassEdit.h TIsAProxy.h TVirtualIsAProxy.h DllImport.h ESTLType.h ROOT/RStringView.hxx Varargs.h diff --git a/core/foundation/inc/ROOT/RVersion.hxx b/core/foundation/inc/ROOT/RVersion.hxx new file mode 100644 index 0000000000000..e8c4869093f97 --- /dev/null +++ b/core/foundation/inc/ROOT/RVersion.hxx @@ -0,0 +1,32 @@ +#ifndef ROOT_RVERSION_HXX +#define ROOT_RVERSION_HXX + +/* Update on release: */ +#define ROOT_VERSION_MAJOR 6 +#define ROOT_VERSION_MINOR 29 +#define ROOT_VERSION_PATCH 01 +#define ROOT_RELEASE_DATE "Dec 21 2022" +/* Don't change the lines below. */ + +/* + * These macros can be used in the following way: + * + * #if ROOT_VERSION_CODE >= ROOT_VERSION(6,32,4) + * #include + * #else + * #include + * #endif + * +*/ + +#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define ROOT_VERSION_CODE ROOT_VERSION(ROOT_VERSION_MAJOR, ROOT_VERSION_MINOR, ROOT_VERSION_PATCH) + +#define R__VERS_QUOTE1(P) #P +#define R__VERS_QUOTE(P) R__VERS_QUOTE1(P) + +#define ROOT_RELEASE R__VERS_QUOTE(ROOT_VERSION_MAJOR) \ + "." R__VERS_QUOTE(ROOT_VERSION_MINOR) \ + "/" R__VERS_QUOTE(ROOT_VERSION_PATCH) + +#endif // ROOT_RVERSION_H diff --git a/core/foundation/inc/RVersion.h b/core/foundation/inc/RVersion.h index ab034438e4487..31b06bb2660b1 100644 --- a/core/foundation/inc/RVersion.h +++ b/core/foundation/inc/RVersion.h @@ -1,23 +1,8 @@ #ifndef ROOT_RVersion #define ROOT_RVersion -/* Version information automatically generated by installer. */ +#include "ROOT/RVersion.hxx" -/* - * These macros can be used in the following way: - * - * #if ROOT_VERSION_CODE >= ROOT_VERSION(6,32,4) - * #include - * #else - * #include - * #endif - * -*/ - -#define ROOT_RELEASE "6.29/01" -#define ROOT_RELEASE_DATE "Dec 21 2022" -#define ROOT_RELEASE_TIME "11:50:22" -#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define ROOT_VERSION_CODE ROOT_VERSION(6,29,1) /* 400641 */ +#define ROOT_RELEASE_TIME "00:00:00" /* not updated anymore */ #endif From 837d996a16906e9cf7e8e2f1f666de739b0bb4da Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 12 Sep 2023 14:52:46 +0200 Subject: [PATCH 3/6] [config] root-config: use CMake variable instead of parsing RVersion.h. --- config/root-config.in | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config/root-config.in b/config/root-config.in index 481e978310f5b..a46ae9802ae5e 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -553,13 +553,7 @@ while test $# -gt 0; do noldflags="yes" ;; --version) - ### Output the version number. If RVersion.h can not be found, give up. - if test -r "${incdir}/RVersion.h"; then - out="$out `sed -n 's,.*ROOT_RELEASE *\"\(.*\)\".*,\1,p' < \"${incdir}/RVersion.h\"`" - else - echo "cannot read ${incdir}/RVersion.h" - exit 1 - fi + out="$out @ROOT_VERSION@" ;; --git-revision) ### Output the git revision number. If RGitCommit.h can not be found, give up. From e0f6444f7c01c4ea3cd8e59cd41b56aeae759ff3 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 12 Sep 2023 14:53:59 +0200 Subject: [PATCH 4/6] [base] Diagnose errors when version version date. --- core/base/src/TROOT.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index 2e153c6f1569f..cfe7927015a40 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -192,13 +192,20 @@ static Int_t IVERSQ() static Int_t IDATQQ(const char *date) { + if (!date) { + Error("TSystem::IDATQQ", "nullptr date string, expected e.g. 'Dec 21 2022'"); + return -1; + } + static const char *months[] = {"Jan","Feb","Mar","Apr","May", "Jun","Jul","Aug","Sep","Oct", "Nov","Dec"}; - char sm[12]; Int_t yy, mm=0, dd; - sscanf(date, "%s %d %d", sm, &dd, &yy); + if (sscanf(date, "%s %d %d", sm, &dd, &yy) != 3) { + Error("TSystem::IDATQQ", "Cannot parse date string '%s', expected e.g. 'Dec 21 2022'", date); + return -1; + } for (int i = 0; i < 12; i++) if (!strncmp(sm, months[i], 3)) { mm = i+1; From 78520d0104ed123cfb259ac1364f025f3f1d7cd8 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Wed, 6 Sep 2023 17:34:15 +0200 Subject: [PATCH 5/6] [proofd] Include RVersion.hxx instead of parsing it. --- proof/proofd/src/XrdROOT.cxx | 92 ++++-------------------------------- 1 file changed, 8 insertions(+), 84 deletions(-) diff --git a/proof/proofd/src/XrdROOT.cxx b/proof/proofd/src/XrdROOT.cxx index c2c6028fe1f18..0233dfd7ac853 100644 --- a/proof/proofd/src/XrdROOT.cxx +++ b/proof/proofd/src/XrdROOT.cxx @@ -19,6 +19,8 @@ // // ////////////////////////////////////////////////////////////////////////// #include "RConfigure.h" +#include "ROOT/RVersion.hxx" +#include "RGitCommit.h" #include "XrdProofdPlatform.h" @@ -44,12 +46,12 @@ XrdROOT::XrdROOT(const char *dir, const char *tag, const char *bindir, fStatus = -1; fSrvProtVers = -1; - fRelease = ""; - fGitCommit = ""; - fVersionCode = -1; - fVrsMajor = -1; - fVrsMinor = -1; - fVrsPatch = -1; + fRelease = ROOT_RELEASE; + fGitCommit = ROOT_GIT_COMMIT; + fVersionCode = ROOT_VERSION_CODE; + fVrsMajor = ROOT_VERSION_MAJOR; + fVrsMinor = ROOT_VERSION_MINOR; + fVrsPatch = ROOT_VERSION_PATCH; // 'dir' must make sense if (!dir || strlen(dir) <= 0) @@ -172,54 +174,6 @@ int XrdROOT::ParseROOTVersionInfo() { XPDLOC(SMGR, "ParseROOTVersionInfo") - int rc = -1; - - XrdOucString versfile = fIncDir; - versfile += "/RVersion.h"; - - // Open file - FILE *fv = fopen(versfile.c_str(), "r"); - if (!fv) { - TRACE(XERR, "unable to open "< 0) break; - } - } - - // Close the file - fclose(fv); - - } else { - TRACE(REQ, "file "< Date: Wed, 6 Sep 2023 17:35:29 +0200 Subject: [PATCH 6/6] [minuit2] pick up ROOT version from ROOTConfig-version.cmake: build/version_number is gone. --- math/minuit2/StandAlone.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/math/minuit2/StandAlone.cmake b/math/minuit2/StandAlone.cmake index 0a662bab5bbd5..1c191677a09ed 100644 --- a/math/minuit2/StandAlone.cmake +++ b/math/minuit2/StandAlone.cmake @@ -12,7 +12,7 @@ include(FeatureSummary) include(CMakeDependentOption) # Check to see if we are inside ROOT and set a smart default -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../build/version_number") +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../rootx/src/rootx.cxx") set(INROOT ON) else() set(INROOT OFF) @@ -30,8 +30,8 @@ endif() include(copy_standalone.cmake) # Copy these files in if needed -copy_standalone(SOURCE ../../build DESTINATION . OUTPUT VERSION_FILE - FILES version_number) +copy_standalone(SOURCE ../.. DESTINATION . OUTPUT VERSION_FILE + FILES ROOTConfig-version.cmake) copy_standalone(SOURCE ../.. DESTINATION . FILES LGPL2_1.txt) @@ -39,9 +39,8 @@ copy_standalone(SOURCE ../.. DESTINATION . copy_standalone(SOURCE ../.. DESTINATION . OUTPUT LICENSE_FILE FILES LICENSE) -file(READ ${VERSION_FILE} versionstr) -string(STRIP ${versionstr} versionstr) -string(REGEX REPLACE "([0-9]+[.][0-9]+)[/]([0-9]+)" "\\1.\\2" versionstr ${versionstr}) +include(${VERSION_FILE}) +string(REGEX REPLACE "([0-9]+[.][0-9]+)[/]([0-9]+)" "\\1.\\2" versionstr ${PACKAGE_VERSION}) project(Minuit2 VERSION ${versionstr}