Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set up Opticks logger #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ install(TARGETS g4ox EXPORT g4oxTargets

add_executable(consgeo consgeo.cpp ../include/argparse/argparse.hpp)
target_link_libraries(consgeo g4ox)
target_include_directories(consgeo PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
target_include_directories(consgeo PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<BUILD_INTERFACE:${OPTICKS_INCLUDE_DIRECTORIES}/G4CX> $<INSTALL_INTERFACE:include>)

add_executable(simg4ox simg4ox.cpp g4app.h ../include/argparse/argparse.hpp)
target_link_libraries(simg4ox g4ox)
target_include_directories(simg4ox PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
target_include_directories(simg4ox PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<BUILD_INTERFACE:${OPTICKS_INCLUDE_DIRECTORIES}/G4CX> $<INSTALL_INTERFACE:include>)

add_executable(simtox simtox.cpp)
target_link_libraries(simtox Opticks::SysRap)
8 changes: 2 additions & 6 deletions src/consgeo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
#include <iostream>
#include <string>

#include <plog/Appenders/ColorConsoleAppender.h>
#include <plog/Formatters/TxtFormatter.h>
#include <plog/Init.h>
#include "SysRap/OPTICKS_LOG.hh"

#include <argparse/argparse.hpp>

Expand All @@ -14,9 +12,7 @@ using namespace std;

int main(int argc, char **argv)
{
using PLogFormat = plog::TxtFormatter;
static plog::ColorConsoleAppender<PLogFormat> consoleAppender;
plog::init(plog::debug, &consoleAppender);
OPTICKS_LOG(argc, argv);

argparse::ArgumentParser program("consgeo", "0.0.0");

Expand Down
4 changes: 4 additions & 0 deletions src/simg4ox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading