From a34cba160f475742f8e82f96e90d98993131dd47 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Wed, 13 Nov 2024 10:38:09 -0500 Subject: [PATCH 1/2] set up Opticks logger --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 2 +- src/simg4ox.cpp | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38ef21f..d3b0d64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ find_package(Geant4 REQUIRED ui_all vis_all) find_package(g4cx REQUIRED) find_package(sysrap REQUIRED) +get_target_property(OPTICKS_INCLUDE_DIRECTORIES Opticks::G4CX INTERFACE_INCLUDE_DIRECTORIES) + add_subdirectory(src) # Install files and export configs diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97964b3..407bb66 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ target_include_directories(consgeo PRIVATE $ $) +target_include_directories(simg4ox PRIVATE $ $ $) add_executable(simtox simtox.cpp) target_link_libraries(simtox Opticks::SysRap) diff --git a/src/simg4ox.cpp b/src/simg4ox.cpp index 7ae1431..a09634c 100644 --- a/src/simg4ox.cpp +++ b/src/simg4ox.cpp @@ -11,12 +11,16 @@ #include "G4UImanager.hh" #include "G4VisExecutive.hh" +#include "SysRap/OPTICKS_LOG.hh" + #include "g4app.h" using namespace std; int main(int argc, char **argv) { + OPTICKS_LOG(argc, argv); + argparse::ArgumentParser program("simg4ox", "0.0.0"); string gdml_file, macro_name; From 8afdb1ac69a2b9f0dc15098029c7cfb494214ad0 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 19 Nov 2024 14:12:38 -0500 Subject: [PATCH 2/2] logger --- src/CMakeLists.txt | 2 +- src/consgeo.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 407bb66..8dec799 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,7 +24,7 @@ install(TARGETS g4ox EXPORT g4oxTargets add_executable(consgeo consgeo.cpp ../include/argparse/argparse.hpp) target_link_libraries(consgeo g4ox) -target_include_directories(consgeo PRIVATE $ $) +target_include_directories(consgeo PRIVATE $ $ $) add_executable(simg4ox simg4ox.cpp g4app.h ../include/argparse/argparse.hpp) target_link_libraries(simg4ox g4ox) diff --git a/src/consgeo.cpp b/src/consgeo.cpp index ea98686..c8157a6 100644 --- a/src/consgeo.cpp +++ b/src/consgeo.cpp @@ -2,9 +2,7 @@ #include #include -#include -#include -#include +#include "SysRap/OPTICKS_LOG.hh" #include @@ -14,9 +12,7 @@ using namespace std; int main(int argc, char **argv) { - using PLogFormat = plog::TxtFormatter; - static plog::ColorConsoleAppender consoleAppender; - plog::init(plog::debug, &consoleAppender); + OPTICKS_LOG(argc, argv); argparse::ArgumentParser program("consgeo", "0.0.0");