Skip to content

Commit

Permalink
Make Association I/O work with python
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Mar 24, 2023
1 parent 688dd2c commit 10e5243
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PODIO_GENERATE_DATAMODEL(datamodel datalayout.yaml headers sources

# Use the cmake building blocks to add the different parts (conditionally)
PODIO_ADD_DATAMODEL_CORE_LIB(TestDataModel "${headers}" "${sources}")
target_sources(TestDataModel PRIVATE DatamodelAssociations.cc)
find_package(nlohmann_json 3.10)
if (nlohmann_json_FOUND)
message(STATUS "Found compatible version of JSON library, will add JSON support to test datamodel")
Expand All @@ -22,6 +23,7 @@ endif()

PODIO_ADD_ROOT_IO_DICT(TestDataModelDict TestDataModel "${headers}" src/selection.xml)
PODIO_ADD_SIO_IO_BLOCKS(TestDataModel "${headers}" "${sources}")
target_sources(TestDataModelSioBlocks PRIVATE DatamodelAssociations.cc)

# Build the extension data model and link it against the upstream model
PODIO_GENERATE_DATAMODEL(extension_model datalayout_extension.yaml ext_headers ext_sources
Expand Down
6 changes: 6 additions & 0 deletions tests/DatamodelAssociations.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "podio/AssociationCollection.h"

#include "datamodel/ExampleMCCollection.h"
#include "datamodel/ExampleWithARelationCollection.h"

PODIO_DECLARE_ASSOCIATION(ExampleMC, ex42::ExampleWithARelation)

0 comments on commit 10e5243

Please sign in to comment.