diff --git a/CMakeLists.txt b/CMakeLists.txt index 62df8749e..6ba40ad8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ if (${USE_ROOT}) endif() find_package(ROOT REQUIRED) include(${ROOT_USE_FILE}) - add_compile_definitions(HAVE_ROOT) + add_compile_definitions(JANA2_HAVE_ROOT) include_directories(${ROOT_INCLUDE_DIRS}) link_libraries(${ROOT_LIBRARIES}) execute_process( @@ -101,7 +101,7 @@ if (${USE_XERCES}) set(XercesC_DIR $ENV{XERCESCROOT}) endif() find_package(XercesC REQUIRED) - add_compile_definitions(HAVE_XERCES) + add_compile_definitions(JANA2_HAVE_XERCES) add_compile_definitions(XERCES3) include_directories(${XercesC_INCLUDE_DIRS}) link_libraries(${XercesC_LIBRARIES}) @@ -123,7 +123,7 @@ endif() if (${USE_PODIO}) find_package(podio REQUIRED) - add_compile_definitions(HAVE_PODIO) + add_compile_definitions(JANA2_HAVE_PODIO) include_directories(SYSTEM ${podio_INCLUDE_DIR}) endif() diff --git a/cmake/MakeConfig.cmake b/cmake/MakeConfig.cmake index f5f7a302c..41eb17ccc 100644 --- a/cmake/MakeConfig.cmake +++ b/cmake/MakeConfig.cmake @@ -12,7 +12,7 @@ # in generating the jana-config script so that it can report those flags # for use when building against this version of JANA. # -# In addition, some variables such as HAVE_ROOT are set which can be used +# In addition, some variables such as JANA2_HAVE_ROOT are set which can be used # in preprocessor directives to conditionally compile code depending on # whether the 3rd party package is present. # @@ -26,7 +26,7 @@ execute_process(COMMAND SBMS/osrelease.pl # ROOT if(DEFINED ENV{ROOTSYS}) - set(HAVE_ROOT 1) + set(JANA2_HAVE_ROOT 1) set(ROOTSYS $ENV{ROOTSYS}) execute_process(COMMAND $ENV{ROOTSYS}/bin/root-config --cflags @@ -38,13 +38,13 @@ if(DEFINED ENV{ROOTSYS}) OUTPUT_STRIP_TRAILING_WHITESPACE) else() # message(STATUS "Did not find ROOT") - set(HAVE_ROOT 0) + set(JANA2_HAVE_ROOT 0) endif() # XERCESC # n.b. this is hard-coded for now to assume XERCES 3 if(DEFINED ENV{XERCESCROOT}) - set(HAVE_XERCES 1) + set(JANA2_HAVE_XERCES 1) set(XERCES3 1) set(XERCESCROOT $ENV{XERCESCROOT}) set(XERCES_CPPFLAGS "-I${XERCESCROOT}/include/xercesc") @@ -56,7 +56,7 @@ if(DEFINED ENV{XERCESCROOT}) else() find_package(XercesC) if(XercesC_FOUND) - set(HAVE_XERCES 1) + set(JANA2_HAVE_XERCES 1) set(XERCES3 1) get_filename_component(XERCESCROOT "${XercesC_INCLUDE_DIRS}" DIRECTORY) set(XERCES_CPPFLAGS "-I${XercesC_INCLUDE_DIRS} -I${XercesC_INCLUDE_DIRS}/xercesc") diff --git a/scripts/jana-config.in b/scripts/jana-config.in index 15cd7f9f7..b6896cc48 100755 --- a/scripts/jana-config.in +++ b/scripts/jana-config.in @@ -20,8 +20,8 @@ BMS_OSNAME="@BMS_OSNAME@" HAVE_MYSQL="@HAVE_MYSQL@" -HAVE_XERCES="@HAVE_XERCES@" -HAVE_ROOT="@HAVE_ROOT@" +JANA2_HAVE_XERCES="@JANA2_HAVE_XERCES@" +JANA2_HAVE_ROOT="@JANA2_HAVE_ROOT@" HAVE_CMSG="@HAVE_CMSG@" HAVE_CURL="@HAVE_CURL@" HAVE_CCDB="@HAVE_CCDB@" diff --git a/scripts/jana-this.csh.in b/scripts/jana-this.csh.in index 35f34503d..89592c4fe 100644 --- a/scripts/jana-this.csh.in +++ b/scripts/jana-this.csh.in @@ -28,7 +28,7 @@ setenv JANA_HOME "@JANA_INSTALL_DIR@" setenv PATH @JANA_INSTALL_DIR@/bin:${PATH} # ROOT -if ( "@HAVE_ROOT@" == "1" ) then +if ( "@JANA2_HAVE_ROOT@" == "1" ) then if ( -f "@ROOTSYS@/bin/thisroot.csh" ) then unsetenv ROOTSYS source "@ROOTSYS@/bin/thisroot.csh" @@ -36,7 +36,7 @@ if ( "@HAVE_ROOT@" == "1" ) then endif # Xerces -if ( "@HAVE_XERCES@" == "1" ) then +if ( "@JANA2_HAVE_XERCES@" == "1" ) then setenv XERCESCROOT "@XERCESCROOT@" # only add to LD_LIBRARY_PATH if XERCESCROOT does not appear to be a system directory if ( ${XERCESCROOT} != /usr ) set MY_TMP_LD_LIBRARY_PATH=${XERCESCROOT}/lib:${MY_TMP_LD_LIBRARY_PATH} diff --git a/scripts/jana-this.sh.in b/scripts/jana-this.sh.in index 0527cccb2..d39be9224 100644 --- a/scripts/jana-this.sh.in +++ b/scripts/jana-this.sh.in @@ -18,7 +18,7 @@ export JANA_HOME="@JANA_INSTALL_DIR@" export PATH=@JANA_INSTALL_DIR@/bin:${PATH} # ROOT -if [ "@HAVE_ROOT@" == "1" ]; then +if [ "@JANA2_HAVE_ROOT@" == "1" ]; then if [ -f "@ROOTSYS@/bin/thisroot.sh" ]; then unset ROOTSYS . "@ROOTSYS@/bin/thisroot.sh" @@ -26,7 +26,7 @@ if [ "@HAVE_ROOT@" == "1" ]; then fi # Xerces -if [ "@HAVE_XERCES@" == "1" ]; then +if [ "@JANA2_HAVE_XERCES@" == "1" ]; then export XERCESCROOT="@XERCESCROOT@" # only add to LD_LIBRARY_PATH if XERCESCROOT does not appear to be a system directory [[ ${XERCESCROOT} != /usr ]] && export LD_LIBRARY_PATH=${XERCESCROOT}/lib:${LD_LIBRARY_PATH} diff --git a/scripts/jana_config.h.in b/scripts/jana_config.h.in index a1979b321..7f9525c13 100644 --- a/scripts/jana_config.h.in +++ b/scripts/jana_config.h.in @@ -2,8 +2,8 @@ // This file was generated by CMake (see cmake/make_config.cmake) // -#define HAVE_ROOT @HAVE_ROOT@ -#define HAVE_XERCES @HAVE_XERCES@ +#define JANA2_HAVE_ROOT @JANA2_HAVE_ROOT@ +#define JANA2_HAVE_XERCES @JANA2_HAVE_XERCES@ #define XERCES3 @XERCES3@ #define HAVE_CCDB @HAVE_CCDB@ #define HAVE_NUMA @HAVE_NUMA@ diff --git a/src/libraries/JANA/CMakeLists.txt b/src/libraries/JANA/CMakeLists.txt index 8a36bf219..18f787360 100644 --- a/src/libraries/JANA/CMakeLists.txt +++ b/src/libraries/JANA/CMakeLists.txt @@ -154,30 +154,56 @@ find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) target_include_directories(jana2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) # So that we can find the generated JVersion.h before install - +target_link_libraries(jana2 ${CMAKE_DL_LIBS} Threads::Threads) if (${USE_PODIO}) - target_link_libraries(jana2 ${CMAKE_DL_LIBS} Threads::Threads podio::podio podio::podioRootIO) -else() - target_link_libraries(jana2 ${CMAKE_DL_LIBS} Threads::Threads) + target_compile_definitions(jana2 PUBLIC JANA2_HAVE_PODIO=1 JANA2_HAVE_ROOT=1) + target_link_libraries(jana2 podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) +elseif (${USE_ROOT}) + target_compile_definitions(jana2 PUBLIC JANA2_HAVE_ROOT=1) + target_link_libraries(jana2 ${ROOT_LIBRARIES}) endif() + # static library, always there add_library(jana2_static_lib STATIC $) set_target_properties(jana2_static_lib PROPERTIES PREFIX "lib" OUTPUT_NAME "JANA") +target_include_directories(jana2_static_lib PUBLIC $) +target_link_libraries(jana2_static_lib ${CMAKE_DL_LIBS} Threads::Threads) + +if (${USE_PODIO}) + target_compile_definitions(jana2_static_lib PUBLIC JANA2_HAVE_PODIO=1 JANA2_HAVE_ROOT=1) + target_link_libraries(jana2_static_lib podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) +elseif (${USE_ROOT}) + target_compile_definitions(jana2_static_lib PUBLIC JANA2_HAVE_ROOT=1) + target_link_libraries(jana2_static_lib ${ROOT_LIBRARIES}) +endif() +install(TARGETS jana2_static_lib EXPORT jana2_targets DESTINATION lib) + + # optionally build shared lib if (BUILD_SHARED_LIBS) - message("-- Build into both shared and static libs") + message(STATUS "Building both shared and static libraries") add_library(jana2_shared_lib SHARED $) set_target_properties(jana2_shared_lib PROPERTIES PREFIX "lib" OUTPUT_NAME "JANA") + + target_include_directories(jana2_shared_lib PUBLIC $) + target_link_libraries(jana2_shared_lib ${CMAKE_DL_LIBS} Threads::Threads) + + if (${USE_PODIO}) + target_compile_definitions(jana2_shared_lib PUBLIC JANA2_HAVE_PODIO=1 JANA2_HAVE_ROOT=1) + target_link_libraries(jana2_shared_lib podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) + elseif (${USE_ROOT}) + target_compile_definitions(jana2_shared_lib PUBLIC JANA2_HAVE_ROOT=1) + target_link_libraries(jana2_shared_lib ${ROOT_LIBRARIES}) + endif() + install(TARGETS jana2_shared_lib EXPORT jana2_targets DESTINATION lib) set(INSTALL_RPATH_USE_LINK_PATH True) else() - message("-- Build into static lib only") + message(STATUS "Building static library only") endif() -# Install library -install(TARGETS jana2_static_lib EXPORT jana2_targets DESTINATION lib) # Install JANATargets.cmake install(EXPORT jana2_targets FILE JANATargets.cmake NAMESPACE JANA:: DESTINATION lib/cmake/JANA) diff --git a/src/libraries/JANA/Compatibility/JGeometryXML.cc b/src/libraries/JANA/Compatibility/JGeometryXML.cc index 8cd7003f5..a9bbae502 100644 --- a/src/libraries/JANA/Compatibility/JGeometryXML.cc +++ b/src/libraries/JANA/Compatibility/JGeometryXML.cc @@ -18,7 +18,7 @@ using namespace std; #include #include "JGeometryXML.h" -#if HAVE_XERCES +#if JANA2_HAVE_XERCES #if XERCES3 // XERCES 3 @@ -66,7 +66,7 @@ JGeometryXML::JGeometryXML(string url, int run, string context):JGeometry(url,ru valid_xmlfile = false; md5_checksum = ""; jcalib = NULL; -#if HAVE_XERCES +#if JANA2_HAVE_XERCES parser = NULL; doc = NULL; #endif @@ -168,7 +168,7 @@ void JGeometryXML::Init(string xmlfile, string xml) /// data member jcalib will also be non-NULL. -#if !HAVE_XERCES +#if !JANA2_HAVE_XERCES (void) xmlfile; // Suppress unused parameter warning (void) xml; // Suppress unused parameter warning jerr<release(); // This seems to be causing seg. faults so it is commented out. @@ -260,7 +260,7 @@ JGeometryXML::~JGeometryXML() #endif } -#if HAVE_XERCES +#if JANA2_HAVE_XERCES //--------------------------------- // MapNodeNames //--------------------------------- @@ -277,7 +277,7 @@ void JGeometryXML::MapNodeNames(xercesc::DOMNode *current_node) MapNodeNames(current_node); // attributes are automatically added as the tree is searched } } -#endif // HAVE_XERCES +#endif // JANA2_HAVE_XERCES //--------------------------------- // Get @@ -316,7 +316,7 @@ bool JGeometryXML::Get(string xpath, string &sval) // the cache entry once the mutex is finally released // below. -#if HAVE_XERCES +#if JANA2_HAVE_XERCES // XERCES locks its own mutex which causes horrible problems if the thread // is canceled while it has the lock. Disable cancelibility while here. @@ -370,7 +370,7 @@ bool JGeometryXML::Get(string xpath, map &svals) if(!valid_xmlfile)return false; -#if HAVE_XERCES +#if JANA2_HAVE_XERCES // XERCES locks its own mutex which causes horrible problems if the thread // is canceled while it has the lock. Disable cancelibility while here. @@ -411,7 +411,7 @@ bool JGeometryXML::GetMultiple(string xpath, vector &vsval) if(!valid_xmlfile){return false;} -#if HAVE_XERCES +#if JANA2_HAVE_XERCES // XERCES locks its own mutex which causes horrible problems if the thread // is canceled while it has the lock. Disable cancelibility while here. @@ -452,7 +452,7 @@ bool JGeometryXML::GetMultiple(string xpath, vector >&vsvals if(!valid_xmlfile){return false;} -#if HAVE_XERCES +#if JANA2_HAVE_XERCES // XERCES locks its own mutex which causes horrible problems if the thread // is canceled while it has the lock. Disable cancelibility while here. @@ -498,7 +498,7 @@ void JGeometryXML::GetXPaths(vector &xpaths, ATTR_LEVEL_t level, const s if(!valid_xmlfile){xpaths.clear(); return;} -#if HAVE_XERCES +#if JANA2_HAVE_XERCES AddNodeToList((DOMNode*)doc->getDocumentElement(), "", xpaths, level); #else (void) level; // Suppress unused parameter warning @@ -724,7 +724,7 @@ void JGeometryXML::ParseXPath(string xpath, vector &svals); bool GetMultiple(string xpath, vector &vsval); @@ -94,11 +94,11 @@ class JGeometryXML:public JGeometry{ string md5_checksum; map found_xpaths; // used to store xpaths already found to speed up subsequent requests pthread_mutex_t found_xpaths_mutex; -#if HAVE_XERCES +#if JANA2_HAVE_XERCES map node_names; -#endif // HAVE_XERCES +#endif // JANA2_HAVE_XERCES -#if HAVE_XERCES +#if JANA2_HAVE_XERCES class SearchParameters{ public: @@ -190,7 +190,7 @@ class JGeometryXML:public JGeometry{ JCalibration *jcalib; bool PRINT_CHECKSUM_INPUT_FILES; }; -#endif // HAVE_XERCES +#endif // JANA2_HAVE_XERCES }; diff --git a/src/libraries/JANA/JEvent.h b/src/libraries/JANA/JEvent.h index fab6ae64b..38075f03a 100644 --- a/src/libraries/JANA/JEvent.h +++ b/src/libraries/JANA/JEvent.h @@ -26,7 +26,7 @@ #include #include "JANA/Utils/JInspector.h" -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO #include namespace podio { class CollectionBase; @@ -53,7 +53,7 @@ class JEvent : public JResettable, public std::enable_shared_from_this void SetFactorySet(JFactorySet* aFactorySet) { delete mFactorySet; mFactorySet = aFactorySet; -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO // Maintain the index of PODIO factories for (JFactory* factory : mFactorySet->GetAllFactories()) { if (dynamic_cast(factory) != nullptr) { @@ -99,7 +99,7 @@ class JEvent : public JResettable, public std::enable_shared_from_this template JFactoryT* Insert(const std::vector& items, const std::string& tag = "") const; // PODIO -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO std::vector GetAllCollectionNames() const; const podio::CollectionBase* GetCollectionBase(std::string name) const; template const typename PodioTypeMap::collection_t* GetCollection(std::string name) const; @@ -140,7 +140,7 @@ class JEvent : public JResettable, public std::enable_shared_from_this JEventSource* mEventSource = nullptr; bool mIsBarrierEvent = false; -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO std::map mPodioFactories; #endif }; @@ -430,7 +430,7 @@ JFactoryT* JEvent::GetSingle(const T* &t, const char *tag, bool exception_if_ return fac; } -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO inline std::vector JEvent::GetAllCollectionNames() const { std::vector keys; @@ -524,7 +524,7 @@ JFactoryPodioT* JEvent::InsertCollectionAlreadyInFrame(const typename PodioTy return typed_factory; } -#endif // HAVE_PODIO +#endif // JANA2_HAVE_PODIO #endif // _JEvent_h_ diff --git a/src/libraries/JANA/JFactoryT.h b/src/libraries/JANA/JFactoryT.h index 4d705974f..0b6be6d5a 100644 --- a/src/libraries/JANA/JFactoryT.h +++ b/src/libraries/JANA/JFactoryT.h @@ -13,7 +13,7 @@ #include #include -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT #include #endif @@ -36,7 +36,7 @@ class JFactoryT : public JFactory { JFactoryT(const std::string& aName, const std::string& aTag) __attribute__ ((deprecated)) : JFactory(aName, aTag) { EnableGetAs(); EnableGetAs( std::is_convertible() ); // Automatically add JObject if this can be converted to it -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT EnableGetAs( std::is_convertible() ); // Automatically add TObject if this can be converted to it #endif } @@ -44,7 +44,7 @@ class JFactoryT : public JFactory { JFactoryT(const std::string& aName) __attribute__ ((deprecated)) : JFactory(aName, "") { EnableGetAs(); EnableGetAs( std::is_convertible() ); // Automatically add JObject if this can be converted to it -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT EnableGetAs( std::is_convertible() ); // Automatically add TObject if this can be converted to it #endif } @@ -52,7 +52,7 @@ class JFactoryT : public JFactory { JFactoryT() : JFactory(JTypeInfo::demangle(), ""){ EnableGetAs(); EnableGetAs( std::is_convertible() ); // Automatically add JObject if this can be converted to it -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT EnableGetAs( std::is_convertible() ); // Automatically add TObject if this can be converted to it #endif } diff --git a/src/libraries/JANA/JMultifactory.cc b/src/libraries/JANA/JMultifactory.cc index f56648232..745663fc5 100644 --- a/src/libraries/JANA/JMultifactory.cc +++ b/src/libraries/JANA/JMultifactory.cc @@ -9,7 +9,7 @@ void JMultifactory::Execute(const std::shared_ptr& event) { -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO if (mNeedPodio) { mPodioFrame = GetOrCreateFrame(event); } diff --git a/src/libraries/JANA/JMultifactory.h b/src/libraries/JANA/JMultifactory.h index 5d95192db..86c15c0a6 100644 --- a/src/libraries/JANA/JMultifactory.h +++ b/src/libraries/JANA/JMultifactory.h @@ -9,7 +9,7 @@ #include #include -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO #include #include "JANA/Podio/JFactoryPodioT.h" #endif @@ -35,7 +35,7 @@ class JMultifactoryHelper : public JFactoryT{ }; -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO // TODO: This redundancy goes away if we merge JFactoryPodioT with JFactoryT template class JMultifactoryHelperPodio : public JFactoryPodioT{ @@ -54,7 +54,7 @@ class JMultifactoryHelperPodio : public JFactoryPodioT{ JMultifactory* GetMultifactory() { return mMultiFactory; } }; -#endif // HAVE_PODIO +#endif // JANA2_HAVE_PODIO class JMultifactory { @@ -73,7 +73,7 @@ class JMultifactory { std::string mFactoryName; // So we can propagate this to the JMultifactoryHelpers, so we can have useful error messages JApplication* mApp; -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO bool mNeedPodio = false; // Whether we need to retrieve the podio::Frame podio::Frame* mPodioFrame = nullptr; // To provide the podio::Frame to SetPodioData, SetCollection #endif @@ -100,7 +100,7 @@ class JMultifactory { template void SetData(std::string tag, std::vector data); -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO template void DeclarePodioOutput(std::string tag, bool owns_data=true); @@ -155,7 +155,7 @@ void JMultifactory::SetData(std::string tag, std::vector data) { if (helper == nullptr) { throw JException("JMultifactory: Attempting to SetData() without corresponding DeclareOutput()"); } -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO // This may or may not be a Podio factory. We find out if it is, and if so, set the frame before calling Set(). auto* typed = dynamic_cast(helper); if (typed != nullptr) { @@ -166,7 +166,7 @@ void JMultifactory::SetData(std::string tag, std::vector data) { } -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO template void JMultifactory::DeclarePodioOutput(std::string tag, bool owns_data) { @@ -212,7 +212,7 @@ void JMultifactory::SetCollection(std::string tag, std::unique_ptrSetCollection(std::move(collection)); } -#endif // HAVE_PODIO +#endif // JANA2_HAVE_PODIO template @@ -221,13 +221,13 @@ void JMultifactoryHelper::Process(const std::shared_ptr &event) mMultiFactory->Execute(event); } -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO template void JMultifactoryHelperPodio::Process(const std::shared_ptr &event) { mMultiFactory->SetApplication(this->GetApplication()); mMultiFactory->Execute(event); } -#endif // HAVE_PODIO +#endif // JANA2_HAVE_PODIO #endif //JANA2_JMULTIFACTORY_H diff --git a/src/libraries/JANA/Podio/JPodioTypeHelpers.h b/src/libraries/JANA/Podio/JPodioTypeHelpers.h index 0e46762a4..bccddf82c 100644 --- a/src/libraries/JANA/Podio/JPodioTypeHelpers.h +++ b/src/libraries/JANA/Podio/JPodioTypeHelpers.h @@ -17,7 +17,7 @@ /// } /// Eventually we hope to hang these type relations off of the Podio types themselves. -#ifdef HAVE_PODIO +#ifdef JANA2_HAVE_PODIO // Sadly, this will only work with C++17 or higher, and for now JANA still supports C++14 (when not using PODIO) template @@ -32,6 +32,6 @@ struct is_podio::collection_t>> : std::t template static constexpr bool is_podio_v = is_podio::value; -#endif //ifdef HAVE_PODIO +#endif //ifdef JANA2_HAVE_PODIO #endif //JANA2_JPODIOTYPEHELPERS_H diff --git a/src/libraries/JANA/Utils/JStringification.cc b/src/libraries/JANA/Utils/JStringification.cc index eae26a721..dc1dc3c16 100644 --- a/src/libraries/JANA/Utils/JStringification.cc +++ b/src/libraries/JANA/Utils/JStringification.cc @@ -47,7 +47,7 @@ void JStringification::GetObjectSummaries(std::map ss << "0x" << std::hex << (uint64_t)jobj << std::dec; objects[ss.str()] = summary; // key is address of object converted to string } -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT // For objects inheriting from TObject, we try and convert members automatically // into JObjectSummary form. This relies on dictionaries being compiled in. // (see ROOT_GENERATE_DICTIONARY for cmake files). @@ -103,7 +103,7 @@ std::string JStringification::ObjectToJSON( const std::string &hexaddr, const JO //------------------------------------------------------------- // GetRootObjectMemberAsString //------------------------------------------------------------- -#if HAVE_ROOT +#if JANA2_HAVE_ROOT /// GetRootObjectMemberAsString is the entry point for converting members of /// TObject derived objects into strings. This really only works for a few /// primitive types, but is useful for debugging/viewing single events. @@ -131,4 +131,4 @@ std::string JStringification::GetRootObjectMemberAsString(const TObject *tobj, c else if( type == "string" ) return GetAddrAsString(addr); return "unknown"; } -#endif // HAVE_ROOT \ No newline at end of file +#endif // JANA2_HAVE_ROOT \ No newline at end of file diff --git a/src/libraries/JANA/Utils/JStringification.h b/src/libraries/JANA/Utils/JStringification.h index f6874983e..18371221d 100644 --- a/src/libraries/JANA/Utils/JStringification.h +++ b/src/libraries/JANA/Utils/JStringification.h @@ -8,13 +8,13 @@ #include -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT #include #include #include #include #include -#endif // HAVE_ROOT +#endif // JANA2_HAVE_ROOT #include #include @@ -44,9 +44,9 @@ class JStringification { template std::string GetAddrAsString(void *addr) const; -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT std::string GetRootObjectMemberAsString(const TObject *tobj, const TDataMember *memitem, std::string type) const; -#endif // HAVE_ROOT +#endif // JANA2_HAVE_ROOT private: diff --git a/src/plugins/JTestRoot/CMakeLists.txt b/src/plugins/JTestRoot/CMakeLists.txt index 5072b134c..c51f78635 100644 --- a/src/plugins/JTestRoot/CMakeLists.txt +++ b/src/plugins/JTestRoot/CMakeLists.txt @@ -34,7 +34,7 @@ if(${USE_ROOT}) ) add_library(JTestRoot_plugin SHARED ${JTestRoot_PLUGIN_SOURCES}) - target_compile_definitions(JTestRoot_plugin PUBLIC HAVE_ROOT) + target_compile_definitions(JTestRoot_plugin PUBLIC JANA2_HAVE_ROOT) target_include_directories(JTestRoot_plugin PUBLIC ${JANA_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS}) target_link_libraries(JTestRoot_plugin jana2) target_link_libraries(JTestRoot_plugin ${ROOT_LIBRARIES}) diff --git a/src/python/common/JEventProcessorPY.h b/src/python/common/JEventProcessorPY.h index d8979ab9d..075860aef 100644 --- a/src/python/common/JEventProcessorPY.h +++ b/src/python/common/JEventProcessorPY.h @@ -29,13 +29,13 @@ using std::endl; #include namespace py = pybind11; -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT #include #include #include #include #include -#endif // HAVE_ROOT +#endif // JANA2_HAVE_ROOT #include #include @@ -113,9 +113,9 @@ class JEventProcessorPY { LOG_ERROR(default_cout_logger) << "Unable to find factory specified for prefetching: factory=" << p.first << " tag=" << p.second << LOG_END; }else { auto v = fac->GetAs(); -#ifdef HAVE_ROOT +#ifdef JANA2_HAVE_ROOT if( v.empty() )fac->GetAs(); -#endif // HAVE_ROOT +#endif // JANA2_HAVE_ROOT _DBG_<<"Prefetching from factory: " << p.first <<":" << p.second << " - " << v.size() << " objects" <