From 96b86ead1bd4b693fc644b062dd387caca4fc47e Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 8 Mar 2022 18:31:53 +0100 Subject: [PATCH 1/5] [cmake] Expose ginclude/ to PCH generation. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93034be00da0c..9cbd7d31dab3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -482,7 +482,7 @@ else() COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch - ${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core + ${__allIncludes} -I${CMAKE_BINARY_DIR}/ginclude -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core DEPENDS rootcling ${__pch_dependencies} ${__pch_dictionaries} ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py From a870b728212bb66a56280268d013b1f982448d9a Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 8 Mar 2022 18:33:03 +0100 Subject: [PATCH 2/5] [cmake] Regularize cmake output for internet check. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cbd7d31dab3c..b5abf96ce8b99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ else() endif() #---Try to download a file to check internet connection----------------------------------------- -message(STATUS "Checking internet connectivity...") +message(STATUS "Checking internet connectivity") file(DOWNLOAD https://root.cern/files/cmake_connectivity_test.txt ${CMAKE_CURRENT_BINARY_DIR}/cmake_connectivity_test.txt TIMEOUT 10 STATUS DOWNLOAD_STATUS ) @@ -130,13 +130,13 @@ list(GET DOWNLOAD_STATUS 0 STATUS_CODE) # Check if download was successful. if(${STATUS_CODE} EQUAL 0) # Succcess - message(STATUS "Yes") + message(STATUS "Checking internet connectivity - found") # Now let's delete the file file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/cmake_connectivity_test.txt) set(NO_CONNECTION FALSE) else() # Error - message(STATUS "No: will not automatically download external dependencies") + message(STATUS "Checking internet connectivity - failed: will not automatically download external dependencies") set(NO_CONNECTION TRUE) endif() From 61d134a3d72fe2d771ba2cf2d10b7ccc3cda10b0 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Tue, 8 Mar 2022 18:35:33 +0100 Subject: [PATCH 3/5] [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 52c14309ed8c2..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", - "Bertrand Bellenot", - "Enrico Guiraud", - "Gerardo Ganis", - "Guilherme Amadio", - "Wouter Verkerke", - "Pere Mato Vila", - "Jakob Blomer", - "Timur Pocheptsov", - "Stephan Hageboeck", - "Matevz Tadel", - "Enric Tejedor Saavedra", - 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 cadd74d062ada187fd6f2675b49fc4f560aaf4d0 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Mon, 14 Nov 2022 14:35:16 +0100 Subject: [PATCH 4/5] [foundation] Fix CVS-style location comment. --- core/foundation/inc/RtypesCore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/foundation/inc/RtypesCore.h b/core/foundation/inc/RtypesCore.h index ed2f5ba3f2d5a..442d769b98647 100644 --- a/core/foundation/inc/RtypesCore.h +++ b/core/foundation/inc/RtypesCore.h @@ -1,4 +1,4 @@ -/* @(#)root/base:$Id$ */ +/* @(#)root/foundation:$Id$ */ /************************************************************************* * Copyright (C) 1995-2014, Rene Brun and Fons Rademakers. * From 2ee230736ee86d6e49940765873d04ca48028da6 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Mon, 14 Nov 2022 14:36:37 +0100 Subject: [PATCH 5/5] [cmake] Move to CMake-generated ROOT/config/RVersion.hxx: Previously, ROOT needed to be built to update the version number, and a version update needed `make version`. This new setup requires simply editing `cmake/modules/ROOTVersion.cmake` to update the version number: nothing needs to be run afterwards, there is no more `version` target. While we are at it, offer ROOT/config/RVersion.hxx as the canonical version file, rather than RVersion.h (which might conflict e.g. with R). --- CMakeLists.txt | 86 +++++++-------------------- build/unix/makeversion.py | 64 -------------------- build/version_number | 1 - cmake/modules/ROOTVersion.cmake | 13 ++++ cmake/modules/RootConfiguration.cmake | 4 +- cmake/modules/RootMacros.cmake | 5 +- config/RVersion.hxx.in | 26 ++++++++ core/CMakeLists.txt | 17 +----- core/foundation/inc/RConfigure.h | 17 ++++++ core/foundation/inc/ROOT/RConfig.hxx | 2 +- core/foundation/inc/RVersion.h | 30 ++++------ math/minuit2/StandAlone.cmake | 14 +++-- 12 files changed, 104 insertions(+), 175 deletions(-) delete mode 100755 build/unix/makeversion.py delete mode 100644 build/version_number create mode 100644 cmake/modules/ROOTVersion.cmake create mode 100644 config/RVersion.hxx.in create mode 100644 core/foundation/inc/RConfigure.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b5abf96ce8b99..7020931d6998f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,22 +16,30 @@ if(WIN32) cmake_policy(SET CMP0091 OLD) endif() -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) - message(FATAL_ERROR - " ROOT must be built out-of-source.\n" - " Please see README/INSTALL for more information.") -endif() - -set(policy_new CMP0072 CMP0077) +set(policy_new CMP0048 CMP0072 CMP0077) foreach(policy ${policy_new}) if(POLICY ${policy}) cmake_policy(SET ${policy} NEW) endif() endforeach() +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR + " ROOT must be built out-of-source.\n" + " Please see README/INSTALL for more information.") +endif() + include(cmake/modules/CaptureCommandLine.cmake) +include(cmake/modules/ROOTVersion.cmake) -project(ROOT) +set(ROOT_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}") + +project(ROOT + VERSION ${ROOT_VERSION} + HOMEPAGE_URL "https://root.cern" +) + +message(STATUS "Building ROOT version v${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}/${ROOT_PATCH_VERSION}") #---Set the locale to default C to prevent issued due to localization of commands--------------- # This is necessary as we for example call `clang -v` and parse its output. But on a localized @@ -64,61 +72,8 @@ set(ROOTSYS ${CMAKE_BINARY_DIR}) set(HEADER_OUTPUT_PATH ${CMAKE_BINARY_DIR}/include) #---Set the ROOT version-------------------------------------------------------------------- -find_package(Git) -if(Git_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) - execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git describe --all - OUTPUT_VARIABLE GIT_DESCRIBE_ALL - RESULT_VARIABLE GIT_DESCRIBE_ERRCODE - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) -else() - set(GIT_DESCRIBE_ERRCODE "NoGit") -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) - 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() - 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 - # GIT_DESCRIBE_ALL: tags/v6-16-00-rc1 - # tag might end on "-rc1" or similar; parse version number in front. - 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}) - 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 - string(REGEX REPLACE "^.*/v([0-9]+)-.*" "\\1" ROOT_MAJOR_VERSION ${GIT_DESCRIBE_ALL}) - string(REGEX REPLACE "^.*/v[0-9]+-([0-9]+).*" "\\1" ROOT_MINOR_VERSION ${GIT_DESCRIBE_ALL}) - set(ROOT_PATCH_VERSION "99") # aka head of ...-patches - 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}") - endif() - set(ROOT_VERSION "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}") - message(STATUS "Detected ROOT_VERSION ${ROOT_VERSION}") -endif() +configure_file(config/RVersion.hxx.in include/ROOT/config/RVersion.hxx NEWLINE_STYLE UNIX) +install(FILES ${CMAKE_BINARY_DIR}/include/ROOT/config/RVersion.hxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ROOT/config/) #---Try to download a file to check internet connection----------------------------------------- message(STATUS "Checking internet connectivity") @@ -558,7 +513,10 @@ add_custom_target(version COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build endif() #---distribution commands------------------------------------------------------------------------ -add_custom_target(distsrc COMMAND ${CMAKE_SOURCE_DIR}/build/unix/makedistsrc.sh "${ROOT_FULL_VERSION}" "${GIT_DESCRIBE_ALWAYS}" "${CMAKE_SOURCE_DIR}") +set(ROOT_GITTAG "${ROOT_MAJOR_VERSION}-${ROOT_MINOR_VERSION}-${ROOT_PATCH_VERSION}") +add_custom_target(distsrc + COMMAND ${CMAKE_SOURCE_DIR}/build/unix/makedistsrc.sh "${ROOT_VERSION}" "${ROOT_GITTAG}" "${CMAKE_SOURCE_DIR}" +) add_custom_target(dist COMMAND cpack --config CPackConfig.cmake) #---Configure and install various files neded later and for clients ----------------------------- 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 4882541c5b02f..0000000000000 --- a/build/version_number +++ /dev/null @@ -1 +0,0 @@ -6.27/01 diff --git a/cmake/modules/ROOTVersion.cmake b/cmake/modules/ROOTVersion.cmake new file mode 100644 index 0000000000000..d2307278f2518 --- /dev/null +++ b/cmake/modules/ROOTVersion.cmake @@ -0,0 +1,13 @@ +# Define the current ROOT version. +# Used to generate ROOT/config/RVersion.hxx and give a version number to packages. + +set(ROOT_MAJOR_VERSION 6) + +# Even for production branches, odd for dev branches. +set(ROOT_MINOR_VERSION 27) + +# Even for releases; 99 for release branches before /00; odd otherwise +set(ROOT_PATCH_VERSION 01) + +# The date of above release +set(ROOT_RELEASE_DATE "Jan 05 2022") diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 2b52afcf9140f..edf8ef350ed7f 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -679,8 +679,8 @@ if(PYTHON_VERSION_STRING_Development_Other) endif() #---RConfigure.h--------------------------------------------------------------------------------------------- -configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in ginclude/RConfigure.h NEWLINE_STYLE UNIX) -install(FILES ${CMAKE_BINARY_DIR}/ginclude/RConfigure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/ROOT/config/RConfigure.hxx NEWLINE_STYLE UNIX) +install(FILES ${CMAKE_BINARY_DIR}/include/ROOT/config/RConfigure.hxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ROOT/config/) #---Configure and install various files---------------------------------------------------------------------- execute_Process(COMMAND hostname OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 3f442cca4c2bb..aa03e9d727dad 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -320,6 +320,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) list(FILTER incdirs EXCLUDE REGEX "^${CMAKE_SOURCE_DIR}") list(FILTER incdirs EXCLUDE REGEX "^${CMAKE_BINARY_DIR}/ginclude") + list(FILTER incdirs EXCLUDE REGEX "^${CMAKE_BINARY_DIR}/include/ROOT/config") list(FILTER incdirs EXCLUDE REGEX "^${CMAKE_BINARY_DIR}/externals") list(FILTER incdirs EXCLUDE REGEX "^${CMAKE_BINARY_DIR}/builtins") list(INSERT incdirs 0 ${CMAKE_BINARY_DIR}/include) @@ -581,7 +582,6 @@ function(ROOT_GENERATE_DICTIONARY dictionary) #---what rootcling command to use-------------------------- if(ARG_STAGE1) set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $) - set(ROOTCINTDEP rconfigure) set(pcm_name) else() if(CMAKE_PROJECT_NAME STREQUAL ROOT) @@ -590,8 +590,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) else() set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" "ROOTIGNOREPREFIX=1" $ -rootbuild) - # Modules need RConfigure.h copied into include/. - set(ROOTCINTDEP rootcling rconfigure) + set(ROOTCINTDEP rootcling) endif() elseif(TARGET ROOT::rootcling) set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{LD_LIBRARY_PATH}" $) diff --git a/config/RVersion.hxx.in b/config/RVersion.hxx.in new file mode 100644 index 0000000000000..e7d5c2da2e0e0 --- /dev/null +++ b/config/RVersion.hxx.in @@ -0,0 +1,26 @@ +#ifndef ROOT_RVersion_hxx +#define 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_MAJOR_VERSION ${ROOT_MAJOR_VERSION} +#define ROOT_MINOR_VERSION ${ROOT_MINOR_VERSION} +#define ROOT_PATCH_VERSION ${ROOT_PATCH_VERSION} +#define ROOT_RELEASE_DATE "${ROOT_RELEASE_DATE}" + +#define ROOT_RELEASE "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}/${ROOT_PATCH_VERSION}" +#define ROOT_RELEASE_TIME "00:00:00" /* for backward compatibility */ + +#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define ROOT_VERSION_CODE ROOT_VERSION(${ROOT_MAJOR_VERSION},${ROOT_MINOR_VERSION},${ROOT_PATCH_VERSION}) + +#endif diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 175acfa10932b..af3cc08445789 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -19,20 +19,6 @@ file(WRITE ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp #endif" ) -set_source_files_properties(${CMAKE_BINARY_DIR}/ginclude/RConfigure.h - PROPERTIES GENERATED TRUE) - -add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/include/RConfigure.h - COMMAND - ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_BINARY_DIR}/ginclude/RConfigure.h - ${CMAKE_BINARY_DIR}/include/RConfigure.h - DEPENDS - ${CMAKE_BINARY_DIR}/ginclude/RConfigure.h -) - -add_custom_target(rconfigure ALL DEPENDS ${CMAKE_BINARY_DIR}/include/RConfigure.h) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/ginclude/RGitCommit.h COMMAND ${CMAKE_COMMAND} -E copy_if_different @@ -143,7 +129,7 @@ target_include_directories(BaseTROOT PRIVATE ${CMAKE_BINARY_DIR}/ginclude ) -add_dependencies(BaseTROOT gitcommit rconfigure) +add_dependencies(BaseTROOT gitcommit) #---------------------------------------------------------------------------------------- if(WIN32) @@ -194,7 +180,6 @@ target_compile_definitions(Core PRIVATE #while basic libs do not depend on Core, we have to add includes directly target_include_directories(Core PUBLIC - $ $ $ $ diff --git a/core/foundation/inc/RConfigure.h b/core/foundation/inc/RConfigure.h new file mode 100644 index 0000000000000..bd5a5997de507 --- /dev/null +++ b/core/foundation/inc/RConfigure.h @@ -0,0 +1,17 @@ +/* @(#)root/foundation:$Id$ */ + +/************************************************************************* + * Copyright (C) 1995-2022, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_RConfigure +#define ROOT_RConfigure + +/* Forward to generated file */ +#include "ROOT/config/RConfigure.hxx" + +#endif diff --git a/core/foundation/inc/ROOT/RConfig.hxx b/core/foundation/inc/ROOT/RConfig.hxx index 2b597ab1b6742..0d2e42f7e48c3 100644 --- a/core/foundation/inc/ROOT/RConfig.hxx +++ b/core/foundation/inc/ROOT/RConfig.hxx @@ -19,7 +19,7 @@ * * *************************************************************************/ -#include "../RVersion.h" +#include "ROOT/config/RVersion.hxx" #include "RConfigure.h" diff --git a/core/foundation/inc/RVersion.h b/core/foundation/inc/RVersion.h index 6379432c17ee6..8c4e9bf4b21fc 100644 --- a/core/foundation/inc/RVersion.h +++ b/core/foundation/inc/RVersion.h @@ -1,23 +1,17 @@ -#ifndef ROOT_RVersion -#define ROOT_RVersion +/* @(#)root/foundation:$Id$ */ -/* Version information automatically generated by installer. */ +/************************************************************************* + * Copyright (C) 1995-2022, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ -/* - * These macros can be used in the following way: - * - * #if ROOT_VERSION_CODE >= ROOT_VERSION(6,32,4) - * #include - * #else - * #include - * #endif - * -*/ +#ifndef ROOT_RVersion +#define ROOT_RVersion -#define ROOT_RELEASE "6.27/01" -#define ROOT_RELEASE_DATE "Jan 05 2022" -#define ROOT_RELEASE_TIME "12:38:43" -#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define ROOT_VERSION_CODE ROOT_VERSION(6,27,1) /* 400129 */ +/* Forward to generated file */ +#include "ROOT/config/RVersion.hxx" #endif diff --git a/math/minuit2/StandAlone.cmake b/math/minuit2/StandAlone.cmake index 0a662bab5bbd5..9d72642bf895c 100644 --- a/math/minuit2/StandAlone.cmake +++ b/math/minuit2/StandAlone.cmake @@ -12,7 +12,9 @@ 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") +set(ROOT_VERSION_DIR ../../cmake/modules) +set(ROOT_VERSION_FILE ROOTVersion.cmake) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ROOT_VERSION_DIR}/${ROOT_VERSION_FILE}") set(INROOT ON) else() set(INROOT OFF) @@ -30,8 +32,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 ${ROOT_VERSION_DIR} DESTINATION . OUTPUT VersionFile.cmake + FILES ${ROOT_VERSION_FILE}) copy_standalone(SOURCE ../.. DESTINATION . FILES LGPL2_1.txt) @@ -39,9 +41,9 @@ 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(VersionFile.cmake) + +set(versionstr "${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}") project(Minuit2 VERSION ${versionstr}