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

services/io/podio: remove unused datamodel_LinkDef.h #1704

Merged
merged 6 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions cmake/jana_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ macro(plugin_add _name)
endif()
endmacro()

# add_dependencies for both a plugin and a library
macro(plugin_add_dependencies _name)
if(${_name}_WITH_PLUGIN)
add_dependencies(${_name}_plugin ${ARGN})
endif(${_name}_WITH_PLUGIN)

if(${_name}_WITH_LIBRARY)
add_dependencies(${_name}_library ${ARGN})
endif(${_name}_WITH_LIBRARY)
endmacro()

# target_link_libraries for both a plugin and a library
macro(plugin_link_libraries _name)
if(${_name}_WITH_PLUGIN)
Expand Down
30 changes: 9 additions & 21 deletions src/services/io/podio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ file(RELATIVE_PATH DATAMODEL_RELATIVE_PATH ${PROJECT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR})

# Generate the datamodel header files.
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}
COMMAND ${CMAKE_COMMAND} -E make_directory
${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}
COMMENT Create datamodel glue directory)
add_custom_command(
OUTPUT
${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}/datamodel_glue.h
Expand All @@ -46,9 +41,15 @@ add_custom_command(
EDM4HEP_INCLUDE_DIR=${EDM4HEP_INTERFACE_INCLUDE_DIRECTORIES}
EDM4EIC_INCLUDE_DIR=${EDM4EIC_INTERFACE_INCLUDE_DIRECTORIES}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/make_datamodel_glue.py
DEPENDS ${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}
${EDM_VERSION_INCLUDES}
COMMENT Create datamodel glue headers)
DEPENDS ${EDM_VERSION_INCLUDES}
COMMENT "Create datamodel glue headers")
add_custom_target(
podio_datamodel_glue
DEPENDS
${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}/datamodel_glue.h
COMMENT "Create datamodel glue headers")

plugin_add_dependencies(${PLUGIN_NAME} podio_datamodel_glue)

# Install datamodel_glue headers
install(
Expand All @@ -70,16 +71,3 @@ plugin_link_libraries(
EDM4EIC::edm4eic
EDM4EIC::edm4eic_utils
podio::podioRootIO)

# Create a ROOT dictionary with the vector<edm4hep::XXXData> types defined.
# Without this, root will complain about not having a compiled CollectionProxy.
root_generate_dictionary(
G__datamodel_vectors
${PROJECT_BINARY_DIR}/include/${DATAMODEL_RELATIVE_PATH}/datamodel_includes.h
MODULE ${PLUGIN_NAME}_plugin LINKDEF datamodel_LinkDef.h)

# Install root dictionaries made by PODIO
set(my_root_dict_files
${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/lib${PLUGIN_NAME}_plugin.rootmap)
install(FILES ${my_root_dict_files} DESTINATION ${PLUGIN_OUTPUT_DIRECTORY})
15 changes: 0 additions & 15 deletions src/services/io/podio/datamodel_LinkDef.h

This file was deleted.

4 changes: 3 additions & 1 deletion src/services/io/podio/make_datamodel_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def AddCollections(datamodelName, collectionfiles):
AddCollections('edm4eic' , collectionfiles_edm4eic )


if WORKING_DIR : os.chdir( WORKING_DIR )
if WORKING_DIR:
os.makedirs(WORKING_DIR, exist_ok=True)
os.chdir(WORKING_DIR)

with open('datamodel_includes.h', 'w') as f:
f.write('\n// This file automatically generated by the make_datamodel.py script\n\n')
Expand Down
Loading