diff --git a/Control/RootUtils/CMakeLists.txt b/Control/RootUtils/CMakeLists.txt index 1ef859b0e00d54ec43cd77cb559b0dfe714dbc72..c9521d6fcdd0060197fd44543fcd059917c661a6 100644 --- a/Control/RootUtils/CMakeLists.txt +++ b/Control/RootUtils/CMakeLists.txt @@ -4,61 +4,55 @@ atlas_subdir( RootUtils ) # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) +find_package( Boost COMPONENTS thread ) find_package( Python COMPONENTS Development ) -find_package( ROOT COMPONENTS RIO Hist Tree PyROOT Core MathCore ROOTTPython ) -string( REPLACE PyROOT Core ROOT_LIBRARIES_NOPYROOT "${ROOT_LIBRARIES}" ) +find_package( ROOT COMPONENTS RIO Hist Tree Core MathCore ROOTTPython + cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} ) # Component(s) in the package: -atlas_generate_reflex_dictionary( dict_cpp RootUtils - HEADER ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/RootUtilsDict.h - SELECTION ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ) +atlas_generate_reflex_dictionary( dict_cpp RootUtils + HEADER ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/RootUtilsDict.h + SELECTION ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/selection.xml + INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES CxxUtils ) atlas_add_library( RootUtils - src/*.cxx ${dict_cpp} - PUBLIC_HEADERS RootUtils - INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES CxxUtils ${Boost_LIBRARIES} - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} TestTools ) - + src/*.cxx ${dict_cpp} + PUBLIC_HEADERS RootUtils + INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES CxxUtils ${Boost_LIBRARIES} + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools ) add_dependencies( RootUtils RootUtilsDictGen ) atlas_add_library( RootUtilsPyROOT - src/pyroot/*.cxx - PUBLIC_HEADERS RootUtils - INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} RootUtils - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools ) + src/pyroot/*.cxx + PUBLIC_HEADERS RootUtils + INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} RootUtils + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools ) atlas_add_dictionary( RootUtilsPyROOTDict - RootUtils/RootUtilsPyROOTDict.h - RootUtils/selection_PyROOT.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT ) + RootUtils/RootUtilsPyROOTDict.h + RootUtils/selection_PyROOT.xml + LINK_LIBRARIES RootUtilsPyROOT ) +# Test(s) in the package: atlas_add_test( Type_test - SOURCES - test/Type_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT - PROPERTIES TIMEOUT 300 ) + SOURCES test/Type_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} RootUtils + PROPERTIES TIMEOUT 300 ) atlas_add_test( TSMethodCall_test - SOURCES - test/TSMethodCall_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT ) + SOURCES test/TSMethodCall_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} RootUtils ) -if( NOT XAOD_ANALYSIS ) -# Doesn't work in AnalysisBase because ROOT_INCLUDE_PATH is not set correctly. atlas_add_test( TTreePatch_test - SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py ) -endif() - + SCRIPT ${Python_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/test/TTreePatch_t.py ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )