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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /cmake/Modules/G4GitUtilities.cmake (Version 11.3.0) and /cmake/Modules/G4GitUtilities.cmake (Version 4.1.p1)


  1 #.rst:                                            
  2 # G4GitUtilities                                  
  3 # --------------                                  
  4 #                                                 
  5 # .. code-block::cmake                            
  6 #                                                 
  7 #   include(G4GitUtilities)                       
  8 #                                                 
  9 # CMake functions and macros for working with     
 10 # Geant4's build/packaging systems.               
 11 #                                                 
 12                                                   
 13 #---------------------------------------------    
 14 # License and Disclaimer                          
 15 #                                                 
 16 # The  Geant4 software  is  copyright of the C    
 17 # the Geant4 Collaboration.  It is provided  u    
 18 # conditions of the Geant4 Software License,      
 19 # LICENSE and available at  http://cern.ch/gea    
 20 # include a list of copyright holders.            
 21 #                                                 
 22 # Neither the authors of this software system,    
 23 # institutes,nor the agencies providing financ    
 24 # work  make  any representation or  warranty,    
 25 # regarding  this  software system or assume a    
 26 # use.  Please see the license in the file  LI    
 27 # for the full disclaimer and the limitation o    
 28 #                                                 
 29 # This  code  implementation is the result of     
 30 # technical work of the GEANT4 collaboration.     
 31 # By using,  copying,  modifying or  distribut    
 32 # any work based  on the software)  you  agree    
 33 # use  in  resulting  scientific  publications    
 34 # acceptance of all terms of the Geant4 Softwa    
 35 #                                                 
 36 #---------------------------------------------    
 37                                                   
 38 include_guard(GLOBAL)                             
 39                                                   
 40 #---------------------------------------------    
 41 #.rst:                                            
 42 # .. cmake:command:: geant4_git_find_dirty        
 43 #                                                 
 44 #   .. code-block:: cmake                         
 45 #                                                 
 46 #     geant4_git_find_dirty(<basedir> <modifie    
 47 #                                                 
 48 #   Runs ``git status`` in the ``<basedir>``,     
 49 #   and untracked/ignored files to ``<modified    
 50 #   respectively.                                 
 51 #                                                 
 52 #   ``<basedir>`` must be the root of the repo    
 53 #   the ``.git/`` directory.                      
 54 #                                                 
 55 #   Nothing is returned in the output variable    
 56 #   git repository or if a ``git`` executable     
 57 #                                                 
 58 function(geant4_git_find_dirty _basedir _outpu    
 59   if(NOT EXISTS "${_basedir}/.git")               
 60     return()                                      
 61   endif()                                         
 62                                                   
 63   find_package(Git QUIET)                         
 64   if(NOT Git_FOUND)                               
 65     return()                                      
 66   endif()                                         
 67                                                   
 68   execute_process(COMMAND ${GIT_EXECUTABLE} st    
 69     WORKING_DIRECTORY "${_basedir}"               
 70     OUTPUT_VARIABLE GEANT4_GIT_UNTRACKED          
 71     ERROR_VARIABLE GEANT4_GIT_UNTRACKED_ERROR)    
 72                                                   
 73   if(GEANT4_GIT_UNTRACKED_ERROR)                  
 74     message(FATAL_ERROR "geant4_git_find_dirty    
 75   endif()                                         
 76                                                   
 77   if(GEANT4_GIT_UNTRACKED)                        
 78     set(_modded_files)                            
 79     set(_untracked_files)                         
 80                                                   
 81     string(REPLACE "\n" ";" GEANT4_GIT_UNTRACK    
 82     foreach(item ${GEANT4_GIT_UNTRACKED})         
 83       if(item MATCHES "^ *(M|A|R|D|C)")           
 84         string(REGEX REPLACE "^ *[MARDC][MARDC    
 85         list(APPEND _modded_files ${_modded_pa    
 86       endif()                                     
 87                                                   
 88       if(item MATCHES "^ *(\\!|\\?)")             
 89         string(REGEX REPLACE "^ *(\\!\\!|\\?\\    
 90         list(APPEND _untracked_files "${_untra    
 91       endif()                                     
 92     endforeach()                                  
 93                                                   
 94     set(${_output_modified} ${_modded_files} P    
 95     set(${_output_untracked} ${_untracked_file    
 96   endif()                                         
 97 endfunction()