diff --git a/src/examples/PodioExample/CMakeLists.txt b/src/examples/PodioExample/CMakeLists.txt index 244144747..6bbe3e07b 100644 --- a/src/examples/PodioExample/CMakeLists.txt +++ b/src/examples/PodioExample/CMakeLists.txt @@ -10,7 +10,7 @@ if (USE_PODIO) add_executable(PodioExample ${PodioExample_SOURCES}) target_link_libraries(PodioExample - PUBLIC jana2 PodioDatamodel PodioDatamodelDict podio::podioRootIO) + PUBLIC jana2_static_lib PodioDatamodel PodioDatamodelDict podio::podioRootIO) set_target_properties(PodioExample PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt index fbd043d47..fcc771d80 100644 --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(catch2) +add_subdirectory(md5) add_subdirectory(tomlplusplus) diff --git a/src/external/md5/CMakeLists.txt b/src/external/md5/CMakeLists.txt new file mode 100644 index 000000000..ed5f3c194 --- /dev/null +++ b/src/external/md5/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_library(VendoredMD5 OBJECT md5.c) +target_include_directories(VendoredMD5 PUBLIC $) + + + diff --git a/src/libraries/JANA/Compatibility/md5.c b/src/external/md5/md5.c similarity index 100% rename from src/libraries/JANA/Compatibility/md5.c rename to src/external/md5/md5.c diff --git a/src/libraries/JANA/Compatibility/md5.h b/src/external/md5/md5.h similarity index 100% rename from src/libraries/JANA/Compatibility/md5.h rename to src/external/md5/md5.h diff --git a/src/libraries/JANA/CMakeLists.txt b/src/libraries/JANA/CMakeLists.txt index 08f5e9f17..39da10619 100644 --- a/src/libraries/JANA/CMakeLists.txt +++ b/src/libraries/JANA/CMakeLists.txt @@ -51,7 +51,6 @@ set(JANA2_SOURCES Compatibility/JStreamLogBuffer.cc Compatibility/JGeometryManager.cc Compatibility/JGeometryXML.cc - Compatibility/md5.c ) if (${USE_PODIO}) @@ -70,6 +69,7 @@ find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) target_link_libraries(jana2 PUBLIC ${CMAKE_DL_LIBS} Threads::Threads) target_link_libraries(jana2 PRIVATE VendoredTomlPlusPlus) +target_link_libraries(jana2 PRIVATE VendoredMD5) # To pull in the header file if (${USE_PODIO}) target_link_libraries(jana2 PUBLIC podio::podio podio::podioRootIO ${ROOT_LIBRARIES}) @@ -79,7 +79,7 @@ endif() # static library, always there -add_library(jana2_static_lib STATIC $) +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 $) @@ -96,7 +96,7 @@ install(TARGETS jana2_static_lib EXPORT jana2_targets DESTINATION lib) # optionally build shared lib if (BUILD_SHARED_LIBS) message(STATUS "Building both shared and static libraries") - add_library(jana2_shared_lib SHARED $) + 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 $) diff --git a/src/libraries/JANA/Calibrations/JLargeCalibration.cc b/src/libraries/JANA/Calibrations/JLargeCalibration.cc index c11481d72..c017d0ed8 100644 --- a/src/libraries/JANA/Calibrations/JLargeCalibration.cc +++ b/src/libraries/JANA/Calibrations/JLargeCalibration.cc @@ -22,7 +22,7 @@ using namespace std; #include #include -#include "JANA/Compatibility/md5.h" +#include static pthread_mutex_t resource_manager_mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/libraries/JANA/Compatibility/JGeometry.h b/src/libraries/JANA/Compatibility/JGeometry.h index f61bb2b5d..12e0c10d3 100644 --- a/src/libraries/JANA/Compatibility/JGeometry.h +++ b/src/libraries/JANA/Compatibility/JGeometry.h @@ -6,7 +6,6 @@ // #pragma once -#include "jerror.h" #include #include diff --git a/src/libraries/JANA/Compatibility/JGeometryXML.cc b/src/libraries/JANA/Compatibility/JGeometryXML.cc index 459b37e67..5a438103d 100644 --- a/src/libraries/JANA/Compatibility/JGeometryXML.cc +++ b/src/libraries/JANA/Compatibility/JGeometryXML.cc @@ -16,6 +16,7 @@ using namespace std; #include #include #include +#include #include "JGeometryXML.h" #if JANA2_HAVE_XERCES diff --git a/src/libraries/JANA/Compatibility/JGeometryXML.h b/src/libraries/JANA/Compatibility/JGeometryXML.h index 0a0eacb7c..7924c0bed 100644 --- a/src/libraries/JANA/Compatibility/JGeometryXML.h +++ b/src/libraries/JANA/Compatibility/JGeometryXML.h @@ -8,15 +8,11 @@ #pragma once #include -#include #include #include #include #include -#include - - #if JANA2_HAVE_XERCES #if !defined(__CINT__) && !defined(__CLING__) diff --git a/src/libraries/JANA/Compatibility/JGetObjectsFactory.h b/src/libraries/JANA/Compatibility/JGetObjectsFactory.h deleted file mode 100644 index ab6cc7114..000000000 --- a/src/libraries/JANA/Compatibility/JGetObjectsFactory.h +++ /dev/null @@ -1,32 +0,0 @@ - -// Copyright 2020, Jefferson Science Associates, LLC. -// Subject to the terms in the LICENSE file found in the top-level directory. - -#pragma once -#include -#include - -template -class JGetObjectsFactory : public JFactoryT { - - /// JGetObjectsFactory allows us to use `JEventSource::GetObjects` with JANA2. - /// Use of GetObjects is deprecated and strongly discouraged in favor of using - /// JEvent::Insert instead. However, rewriting the halld event sources is a - /// monumental task, so we keep GetObjects for now and use this as the mechanism - /// to call into it. - -public: - JGetObjectsFactory(std::string tag="") { - JFactory::SetTag(tag); - } - - void Process(const std::shared_ptr& event) { - JEventSource* source = event->GetJEventSource(); - source->GetObjects(event, this); - // if (!result) throw JException("JGetObjectsFactory registered with a source that doesn't provide said objects"); - // JANA can't/shouldn't distinguish between "Source can't provide said objects" and "Source provided zero" - // Examples: DMCThrown, DDIRCTruthBarHit - JFactory::mCreationStatus = JFactory::CreationStatus::InsertedViaGetObjects; - } - -}; diff --git a/src/programs/jana/CMakeLists.txt b/src/programs/jana/CMakeLists.txt index 6e0a156ef..312316e88 100644 --- a/src/programs/jana/CMakeLists.txt +++ b/src/programs/jana/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(jana jana.cc ) find_package(Threads REQUIRED) -target_link_libraries(jana jana2 Threads::Threads) +target_link_libraries(jana jana2_static_lib Threads::Threads) target_link_options(jana PRIVATE -rdynamic) install(TARGETS jana DESTINATION bin)