From d348512faa4eb6eea145a587d25a2f90034e166c Mon Sep 17 00:00:00 2001 From: zoujh <zoujh@ihep.ac.cn> Date: Mon, 12 Aug 2019 23:38:10 +0800 Subject: [PATCH] generate dictionary for plcio --- Event/CMakeLists.txt | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Event/CMakeLists.txt b/Event/CMakeLists.txt index 256b71ad..bb764a76 100644 --- a/Event/CMakeLists.txt +++ b/Event/CMakeLists.txt @@ -1,8 +1,9 @@ gaudi_subdir(Event v0r0) +# Declare PODIO dependency find_package(podio REQUIRED HINTS $ENV{PODIO}) -# Make sure the library is found. -# Not the case if LD_LIBRARY_PATH is wrong +## Make sure the library is found. +## Not the case if LD_LIBRARY_PATH is wrong find_library(PODIOLIB podio PATHS ${podio_DIR}/../lib) if (NOT PODIOLIB) message(FATAL_ERROR "libpodio.so(dylib) cannot be found dynamically. Make sure you have set up your environment to use PODIO") @@ -16,18 +17,32 @@ include_directories( ${podio_INCLUDE_DIRS} ) -set(Event_srcs - src/*.cc - ) +# Declare ROOT dependency +list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +find_package(ROOT REQUIRED COMPONENTS RIO Tree) +include_directories(${ROOT_INCLUDE_DIR}) +include(${ROOT_USE_FILE}) + +# Settings +file(GLOB sources src/*.cc) +file(GLOB headers Event/*.h) +include_directories(Event) + +# Dictionary and Modules +REFLEX_GENERATE_DICTIONARY(Event ${headers} SELECTION src/selection.xml) +add_library(EventDict SHARED Event.cxx) +add_dependencies(EventDict Event-dictgen) +target_link_libraries(EventDict Event ROOT::Core) + +add_library(Event SHARED ${sources} ${headers}) +target_link_libraries(Event podio ROOT::RIO ROOT::Tree) # Headers and Libraries gaudi_install_headers(Event) -# Modules -gaudi_add_module(Event ${Event_srcs} - INCLUDE_DIRS Event - #LINK_LIBRARIES GaudiKernel -) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/EventDict.rootmap DESTINATION lib) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Event_rdict.pcm DESTINATION lib) # Unit tests #gaudi_add_test(HelloAlg -- GitLab