Alternatives to ROOT_GENERATE_DICTIONARY

Dear all,
I have a CMake project where i generate dictionaries to build python bindings for some classes I have and the I/O features for them in ROOT.

I wonder if there is some faster version of the current macro.

I am not sure I am using the correct workflow but basically for a given module of the analysis the strategy used is :

#Declare function to generate dictionaries!
function(GENERATE_DICTIONARY dictionary)
    if(${ROOT_VERSION} LESS 6.0)
        ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
    else()
        ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
    endif()
endfunction()


set(PROJECT kernel)

file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.hpp)

file(GLOB HEADERS2 ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h)
message(STATUS "SRCS = ${SOURCES}")
message(STATUS "INCS = ${HEADERS}")

ROOT_GENERATE_DICTIONARY(${PROJECT}Dict ${HEADERS} LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/LinkDef.h MODULE ${PROJECT
})

add_library(${PROJECT} SHARED ${SOURCES} ${PROJECT}Dict.cxx)

target_link_libraries(${PROJECT} PUBLIC ${PKG_LIBRARIES} velo)

What do you mean by the following?

Just a comment on your CMake. In general the use of GLOB to build lists of sources is discouraged. The recommendation is to be explicit with every file added. Your LinkDef probably doesn’t update when a new file is placed int he directory and added by GLOB for example.

I mean if the ROOT Generate Dictionary macro is the only possibility inside root to generate dictionaries and python bindings or if there are other macros available.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.