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

fix: depend on datamodel version headers in datamodel glue #843

Merged
merged 5 commits into from
Aug 16, 2023
Merged
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
28 changes: 19 additions & 9 deletions src/services/io/podio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,24 @@ plugin_glob_all(${PLUGIN_NAME})
get_target_property(EDM4HEP_INTERFACE_INCLUDE_DIRECTORIES EDM4HEP::edm4hep INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(EDM4EIC_INTERFACE_INCLUDE_DIRECTORIES EDM4EIC::edm4eic INTERFACE_INCLUDE_DIRECTORIES)

# Get the datamodel version headers
set(EDM_VERSION_INCLUDES )
if(${EDM4HEP_VERSION} VERSION_GREATER_EQUAL "0.9")
list(APPEND EDM_VERSION_INCLUDES ${EDM4HEP_INTERFACE_INCLUDE_DIRECTORIES}/edm4hep/EDM4hepVersion.h)
endif()
if(${EDM4EIC_VERSION} VERSION_GREATER_EQUAL "2.1.0")
list(APPEND EDM_VERSION_INCLUDES ${EDM4EIC_INTERFACE_INCLUDE_DIRECTORIES}/edm4eic/EDM4eicVersion.h)
endif()

# Generate the datamodel header files.
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/datamodel_glue.h ${CMAKE_CURRENT_BINARY_DIR}/datamodel_includes.h
COMMAND python3 ${PROJECT_SOURCE_DIR}/make_datamodel_glue.py
WORKING_DIR=${CMAKE_CURRENT_BINARY_DIR}
EDM4HEP_INCLUDE_DIR=${EDM4HEP_INTERFACE_INCLUDE_DIRECTORIES}
EDM4EIC_INCLUDE_DIR=${EDM4EIC_INTERFACE_INCLUDE_DIRECTORIES}
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/make_datamodel_glue.py
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/datamodel_glue.h ${CMAKE_CURRENT_BINARY_DIR}/datamodel_includes.h
COMMAND python3 ${PROJECT_SOURCE_DIR}/make_datamodel_glue.py
WORKING_DIR=${CMAKE_CURRENT_BINARY_DIR}
EDM4HEP_INCLUDE_DIR=${EDM4HEP_INTERFACE_INCLUDE_DIRECTORIES}
EDM4EIC_INCLUDE_DIR=${EDM4EIC_INTERFACE_INCLUDE_DIRECTORIES}
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/make_datamodel_glue.py
DEPENDS ${EDM_VERSION_INCLUDES}
)

# Add include directories (works same as target_include_directories)
Expand All @@ -53,7 +63,7 @@ root_generate_dictionary(G__datamodel_vectors ${datamodel_BINARY_DIR}/datamodel_

# Install root dictionaries made by PODIO
set(my_root_dict_files
${PROJECT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin_rdict.pcm
${PROJECT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin.rootmap
)
${PROJECT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin_rdict.pcm
${PROJECT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin.rootmap
)
install(FILES ${my_root_dict_files} DESTINATION ${PLUGIN_OUTPUT_DIRECTORY})
Loading