diff --git a/README.md b/README.md index 3c59144335cd3eebae922392cfb2c5f3b2e20f59..5c0ac5f3b71604c0e9f07e514aa42bb3735af91b 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,27 @@ cmake ../. -DCMAKE_INSTALL_PREFIX=$HOME/my_exp_soft make -j4 install ``` -All done. Now you can run `hc_analyzer` and you're off to analyze. +All done. Now you can run `hcana` and you're off to analyze. + +#### Loading the libraries into ROOT + +``` +// .rootlogon.C +{ + gSystem->AddIncludePath(" -Iinclude/podd" ); + gSystem->AddIncludePath(" -Iinclude/hcana"); + gSystem->AddIncludePath(" -Iinclude/evio" ); + gInterpreter->AddIncludePath("include/podd" ); + gInterpreter->AddIncludePath("include/hcana"); + gInterpreter->AddIncludePath("include/evio" ); + + gSystem->Load("libevioxx.so"); + gSystem->Load("libHallA.so"); + gSystem->Load("libdc.so"); + gSystem->Load("libHallC.so"); +} +``` + ### Other builds diff --git a/docs/libHallC_in_root.png b/docs/libHallC_in_root.png new file mode 100644 index 0000000000000000000000000000000000000000..0956db8783434e6faef684fe9aaa1cd33211bb1b Binary files /dev/null and b/docs/libHallC_in_root.png differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 761458394cf9ef7efccb732c095214e5304f8c0d..29f19bd4c28ec6aff7cd0f19bbd574040d988c23 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -61,8 +61,6 @@ target_include_directories(HallC target_compile_options(HallC PRIVATE $<$<CXX_COMPILER_ID:GNU>:-DHAS_SSTREAM=1>) target_link_libraries(HallC - #PUBLIC ${EXPAT_LIBRARIES} - #PUBLIC ${CMAKE_THREAD_LIBS_INIT} PUBLIC ${ROOT_LIBRARIES} PUBLIC PODD::HallA PUBLIC PODD::Decode @@ -70,8 +68,8 @@ target_link_libraries(HallC #This is required so that the exported target has the name JSONUtils and not jsonutils #set_target_properties(HallC PROPERTIES EXPORT_NAME hallC) -add_executable(hc_analyzer main.C) -target_include_directories(hc_analyzer +add_executable(hcana main.C) +target_include_directories(hcana PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> @@ -82,15 +80,13 @@ target_include_directories(hc_analyzer ) #target_compile_features(HallC PRIVATE cxx_auto_type) -target_compile_options(hc_analyzer PRIVATE $<$<CXX_COMPILER_ID:GNU>:-DHAS_SSTREAM=1>) -target_link_libraries(hc_analyzer +target_compile_options(hcana PRIVATE $<$<CXX_COMPILER_ID:GNU>:-DHAS_SSTREAM=1>) +target_link_libraries(hcana PUBLIC HallC - PUBLIC PODD::HallA - PUBLIC PODD::Decode PUBLIC ${ROOT_LIBRARIES} ) -install(TARGETS HallC hc_analyzer +install(TARGETS HallC hcana EXPORT HCANA-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}