Commit 000ffe19 authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'root_dict_generate' into 'master'

ROOT Dict Generation: Solve Issues with Inline Headers

See merge request allpix-squared/allpix-squared!724
parents 5b1f227a 55e3dcc5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include "core/module/Event.hpp"
#include "core/utils/log.h"
#include "objects/PixelCharge.hpp"
#include "objects/exceptions.h"

#include <set>
#include <string>
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include "core/utils/distributions.h"
#include "core/utils/log.h"
#include "objects/exceptions.h"
#include "tools/runge_kutta.h"

using namespace allpix;
+28 −27
Original line number Diff line number Diff line
@@ -18,26 +18,46 @@ ELSE()
    INCLUDE(${ROOT_MACROS_FILE})
ENDIF()

# Define the library adding the object file created above
ADD_LIBRARY(
    AllpixObjects SHARED
    Object.cpp
    Pixel.cpp
    SensorCharge.cpp
    Pulse.cpp
    PixelCharge.cpp
    DepositedCharge.cpp
    PropagatedCharge.cpp
    PixelHit.cpp
    MCParticle.cpp
    MCTrack.cpp)

# Link the standard dependencies
TARGET_LINK_LIBRARIES(AllpixObjects PUBLIC ${ALLPIX_DEPS_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(AllpixObjects PUBLIC $<INSTALL_INTERFACE:include>)

# Generate the ROOT dictionary
# NOTE these headers will be inlined in the generated dictionary. Therefore their order needs to reflect dependencies
# between them such that at the time of reference, all classes are defined already.
ROOT_GENERATE_DICTIONARY(
    AllpixObjectsDictionary
    ${CMAKE_CURRENT_SOURCE_DIR}/Object.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/MCTrack.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/MCParticle.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/SensorCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/PropagatedCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/DepositedCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/PixelCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Pulse.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Pixel.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/PropagatedCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/PixelCharge.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/PixelHit.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Pulse.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/MCParticle.hpp
    ${CMAKE_CURRENT_SOURCE_DIR}/MCTrack.hpp
    MODULE
    AllpixObjects
    LINKDEF
    ${CMAKE_CURRENT_SOURCE_DIR}/Linkdef.h
    OPTIONS
    -inlineInputHeader
    -I${CMAKE_CURRENT_SOURCE_DIR}
    MODULE
    AllpixObjects)
    -I${CMAKE_CURRENT_SOURCE_DIR})

SET_SOURCE_FILES_PROPERTIES(
    ${CMAKE_CURRENT_BINARY_DIR}/AllpixObjectsDictionary.cxx
@@ -46,25 +66,6 @@ SET_SOURCE_FILES_PROPERTIES(
               "-Wno-unused-function -Wno-overlength-strings -Wno-zero-as-null-pointer-constant -w" # or whatever ?
)

# Define the library adding the object file created above
ADD_LIBRARY(
    AllpixObjects SHARED
    Object.cpp
    Pixel.cpp
    SensorCharge.cpp
    Pulse.cpp
    PixelCharge.cpp
    DepositedCharge.cpp
    PropagatedCharge.cpp
    PixelHit.cpp
    MCParticle.cpp
    MCTrack.cpp
    ${CMAKE_CURRENT_BINARY_DIR}/AllpixObjectsDictionary.cxx)

# Link the standard dependencies
TARGET_LINK_LIBRARIES(AllpixObjects PUBLIC ${ALLPIX_DEPS_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(AllpixObjects PUBLIC $<INSTALL_INTERFACE:include>)

# Specify install for the messages
INSTALL(
    TARGETS AllpixObjects
+22 −14
Original line number Diff line number Diff line
@@ -24,30 +24,38 @@
    ROOT::Math::DefaultCoordinateSystemTag> +                                                                               \
    ;

// AP2 objects
// APSQ objects
// NOTE: The order here is important - classes that are used or included in other classes need to be placed first such that
// all dependencies can be resolved also when inlining these headers for dictionary generation.
#pragma link C++ class allpix::Object + ;

#pragma link C++ class allpix::MCTrack + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::MCTrack> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::MCTrack> + ;

#pragma link C++ class allpix::MCParticle + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::MCParticle> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::MCParticle> + ;

#pragma link C++ class allpix::SensorCharge + ;
#pragma link C++ class allpix::PropagatedCharge + ;

#pragma link C++ class allpix::DepositedCharge + ;
#pragma link C++ class allpix::Pixel + ;
#pragma link C++ class allpix::PixelCharge + ;
#pragma link C++ class allpix::PixelHit + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::DepositedCharge> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::DepositedCharge> + ;

#pragma link C++ class allpix::Pulse + ;
#pragma link C++ class allpix::Pixel + ;

#pragma link C++ class allpix::Object::PointerWrapper < allpix::MCTrack> + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::MCParticle> + ;
#pragma link C++ class allpix::PropagatedCharge + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::PropagatedCharge> + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::DepositedCharge> + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::PixelCharge> + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::PixelHit> + ;

#pragma link C++ class allpix::Object::BaseWrapper < allpix::MCTrack> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::MCParticle> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::PropagatedCharge> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::DepositedCharge> + ;

#pragma link C++ class allpix::PixelCharge + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::PixelCharge> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::PixelCharge> + ;

#pragma link C++ class allpix::PixelHit + ;
#pragma link C++ class allpix::Object::PointerWrapper < allpix::PixelHit> + ;
#pragma link C++ class allpix::Object::BaseWrapper < allpix::PixelHit> + ;

// Vector of Object for internal storage
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@

#include "Pulse.hpp"

#include "objects/exceptions.h"

#include <cmath>
#include <numeric>

Loading