Skip to content

Commit

Permalink
Merge pull request #55 from KATRIN-Experiment/PhysicalConstants2021
Browse files Browse the repository at this point in the history
Updating physical constants.
  • Loading branch information
zykure authored Oct 20, 2021
2 parents 62378e2 + 8e769a8 commit e5d6a2f
Show file tree
Hide file tree
Showing 4 changed files with 634 additions and 157 deletions.
19 changes: 16 additions & 3 deletions Kommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,24 @@ endif()

option( KLogger_THROW_EXCEPTIONS "Throw exception when using KERROR/KFATAL macros." OFF )
if( KLogger_THROW_EXCEPTIONS )
set_source_files_properties(Core/Logging/KLogger.cxx PROPERTIES COMPILE_DEFINITIONS
"KLOGGER_THROW_EXCEPTIONS"
)
set_source_files_properties(Core/Logging/KLogger.cxx PROPERTIES COMPILE_DEFINITIONS
"KLOGGER_THROW_EXCEPTIONS"
)
endif()
mark_as_advanced( CLEAR KLogger_THROW_EXCEPTIONS )

set( KConst_REFERENCE_EPOCH 2021 CACHE STRING "Reference epoch for physical constants defined in 'KConst.h'. Follows PDG data releases." )
set_property(CACHE KConst_REFERENCE_EPOCH PROPERTY STRINGS 2006 2021) # make drop-down list of allowed values

if(KConst_REFERENCE_EPOCH GREATER 2006)
message(WARNING "*** Using updated physical constants ***\n"
"Kasper was configured to use physical constants based on 2021 datasets. This will affect the outcome "
"of some calculations. To restore *old* behavior, set KConst_REFERENCE_EPOCH=2006.")
elseif(KConst_REFERENCE_EPOCH LESS 2021)
message(WARNING "*** Using outdated physical constants ***\n"
"Kasper was configured to use physical constants based on 2006 datasets. This will affect the outcome "
"of some calculations. To restore *default* behavior, set KConst_REFERENCE_EPOCH=2021.")
endif()

# to be populated by subdirectories
set(KOMMON_HEADER_FILES)
Expand Down Expand Up @@ -87,6 +99,7 @@ foreach(HEADER ${KOMMON_HEADER_FILES})
target_include_directories(Kommon PUBLIC $<BUILD_INTERFACE:${DIRNAME}>)
endforeach(HEADER)
target_include_directories(Kommon PUBLIC $<INSTALL_INTERFACE:include>)
target_compile_definitions(Kommon PUBLIC KConst_REFERENCE_EPOCH=${KConst_REFERENCE_EPOCH})

if( KASPER_USE_BOOST )
target_compile_definitions(Kommon PUBLIC KASPER_USE_BOOST)
Expand Down
1 change: 1 addition & 0 deletions Kommon/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ set(KOMMON_CORE_HEADER_FILES
Utility/KException.h
Utility/KCast.h
Utility/KConst.h
Utility/KConst_2006.h
Utility/KConsoleMuter.h
Utility/KHash.h
Utility/OstreamJoiner.h
Expand Down
Loading

0 comments on commit e5d6a2f

Please sign in to comment.