diff --git a/CMakeLists.txt b/CMakeLists.txt index 3efcbd8..af46014 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,111 +1,121 @@ # Top level CMakeLists.txt for EvtGen # Enforce an out-of-source build. # Should be the first action in the top level CMakeLists.txt if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(STATUS "EvtGen requires an out-of-source build.") message(STATUS "Please remove the following files from ${CMAKE_BINARY_DIR}:") message(STATUS " CMakeCache.txt") message(STATUS " CMakeFiles") message(STATUS "Once these files are removed, create a separate directory") message(STATUS "and run CMake from there, pointing it to:") message(STATUS " ${CMAKE_SOURCE_DIR}") message(FATAL_ERROR "in-source build detected") endif() # Also require a minimum version of CMake cmake_minimum_required(VERSION 3.11.0) # Project setup if(${CMAKE_VERSION} VERSION_LESS 3.12.0) project(EvtGen VERSION 2.0.0 DESCRIPTION "Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons." ) else() project(EvtGen VERSION 2.0.0 DESCRIPTION "Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons." HOMEPAGE_URL "https://evtgen.hepforge.org" ) endif() # Prepend this project's custom module path(s) to CMAKE_MODULE_PATH set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH}) # Include needed modules to perform any custom setup # Install paths include(GNUInstallDirs) # Compilation/linking flags and related settings include(CompilerFlags) # EvtGen external dependencies option(EVTGEN_PYTHIA "Enable/disable linking with Pythia8" OFF) option(EVTGEN_PHOTOS "Enable/disable linking with Photos++" OFF) option(EVTGEN_TAUOLA "Enable/disable linking with Tauola++" OFF) option(EVTGEN_HEPMC3 "Enable/disable linking with HepMC3" ON) if (EVTGEN_HEPMC3) message(STATUS "EvtGen: Linking with HepMC3") else() message(STATUS "EvtGen: Linking with HepMC2") endif() message(STATUS "EvtGen: Optional linking with Pythia8 EVTGEN_PYTHIA ${EVTGEN_PYTHIA}") message(STATUS "EvtGen: Optional linking with Photos++ EVTGEN_PHOTOS ${EVTGEN_PHOTOS}") message(STATUS "EvtGen: Optional linking with Tauola++ EVTGEN_TAUOLA ${EVTGEN_TAUOLA}") message(STATUS "EvtGen: Optional linking with HepMC3 EVTGEN_HEPMC3 ${EVTGEN_HEPMC3}") include(ExternalDependencies) # Now build the library add_subdirectory(src) # Copy the particle property and decay tables configure_file(DECAY.DEC ${CMAKE_CURRENT_BINARY_DIR}/DECAY.DEC COPYONLY) configure_file(DECAY.XML ${CMAKE_CURRENT_BINARY_DIR}/DECAY.XML COPYONLY) configure_file(evt.pdl ${CMAKE_CURRENT_BINARY_DIR}/evt.pdl COPYONLY) +# Copy the older particle property and decay tables +configure_file(DECAY_2009.DEC ${CMAKE_CURRENT_BINARY_DIR}/DECAY_2009.DEC COPYONLY) +configure_file(DECAY_2009.XML ${CMAKE_CURRENT_BINARY_DIR}/DECAY_2009.XML COPYONLY) +configure_file(DECAY_2010.DEC ${CMAKE_CURRENT_BINARY_DIR}/DECAY_2010.DEC COPYONLY) +configure_file(DECAY_2010.XML ${CMAKE_CURRENT_BINARY_DIR}/DECAY_2010.XML COPYONLY) # Build the executables in the test and validation directories +option(EVTGEN_BUILD_DOC "Enable/disable building of documentation in 'doc' directory" OFF) option(EVTGEN_BUILD_TESTS "Enable/disable building of executables in 'test' directory" OFF) option(EVTGEN_BUILD_VALIDATIONS "Enable/disable building of executables in 'validation' directory" OFF) +message(STATUS "EvtGen: Building of documentation in 'doc' directory EVTGEN_BUILD_DOC ${EVTGEN_BUILD_DOC}") message(STATUS "EvtGen: Building of executables in 'test' directory EVTGEN_BUILD_TESTS ${EVTGEN_BUILD_TESTS}") message(STATUS "EvtGen: Building of executables in 'validation' directory EVTGEN_BUILD_VALIDATIONS ${EVTGEN_BUILD_VALIDATIONS}") +if(${EVTGEN_BUILD_DOC}) + add_subdirectory(doc) +endif() if(${EVTGEN_BUILD_TESTS}) add_subdirectory(test) endif() if(${EVTGEN_BUILD_VALIDATIONS}) add_subdirectory(validation) endif() # Install the include directories install(DIRECTORY EvtGen DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY EvtGenBase DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY EvtGenExternal DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY EvtGenModels DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Install the particle properties and decay tables -install(FILES DECAY.DEC DECAY.XML evt.pdl DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen) +install(FILES DECAY.DEC DECAY.XML evt.pdl DECAY_2010.XML DECAY_2010.DEC DECAY_2009.XML DECAY_2009.DEC DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen) # Generate CMake config files, which can be used by other projects include(CMakePackageConfigHelpers) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) configure_package_config_file(cmake/Templates/EvtGenConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/EvtGenConfig.cmake INSTALL_DESTINATION cmake PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR ) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/EvtGenConfigVersion.cmake COMPATIBILITY AnyNewerVersion ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/EvtGenConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/EvtGenConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen/cmake ) install( EXPORT "EvtGenTargets" NAMESPACE "EvtGen::" DESTINATION ${CMAKE_INSTALL_DATADIR}/EvtGen/cmake ) diff --git a/cmake/Templates/EvtGenConfig.cmake.in b/cmake/Templates/EvtGenConfig.cmake.in index 623935b..5d5094f 100644 --- a/cmake/Templates/EvtGenConfig.cmake.in +++ b/cmake/Templates/EvtGenConfig.cmake.in @@ -1,8 +1,9 @@ @PACKAGE_INIT@ include("${CMAKE_CURRENT_LIST_DIR}/EvtGenTargets.cmake") set_and_check(EVTGEN_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") set_and_check(EVTGEN_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@") +set_and_check(EVTGEN_DATA_DIR "@PACKAGE_DATA_INSTALL_DIR@") check_required_components("@PROJECT_NAME@") diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f2123dd..e01eca4 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,22 +1,36 @@ find_program(LATEX NAMES latex HINTS ${LATEX} PATHS $ENV{PATH} /usr/bin/ /usr/local/bin ) find_program(BIBTEX NAMES bibtex HINTS ${BIBTEX} PATHS $ENV{PATH} /usr/bin/ /usr/local/bin ) find_program(MAKEINDEX NAMES makeindex HINTS ${MAKEINDEX} PATHS $ENV{PATH} /usr/bin/ /usr/local/bin ) find_program(DVIPS NAMES dvips HINTS ${DVIPS} PATHS $ENV{PATH} /usr/bin/ /usr/local/bin ) -if ( LATEX AND MAKEINDEX and DVIPS ) +if ( LATEX AND BIBTEX AND MAKEINDEX AND DVIPS ) MESSAGE(STATUS "EvtGen doc: Using LATEX=${LATEX} BIBTEX=${BIBTEX} MAKEINDEX=${MAKEINDEX} DVIPS=${DVIPS}.") -add_custom_target(GUIDE ALL + +file(GLOB EVTGEN_DOC_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/*.tex + ${CMAKE_CURRENT_SOURCE_DIR}/*.eps + ${CMAKE_CURRENT_SOURCE_DIR}/*.fig + ${CMAKE_CURRENT_SOURCE_DIR}/*.pdf + ${CMAKE_CURRENT_SOURCE_DIR}/*.bib + ) + +foreach ( s ${EVTGEN_DOC_SOURCES} ) +configure_file(${s} ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY) +endforeach ( s ${EVTGEN_DOC_SOURCES} ) +ADD_CUSTOM_COMMAND(OUTPUT guide.ps COMMAND ${LATEX} guide -COMMAND ${BIBTEX} bibtex guide +COMMAND ${BIBTEX} guide COMMAND ${LATEX} guide COMMAND ${MAKEINDEX} guide COMMAND ${LATEX} guide COMMAND ${DVIPS} guide.dvi -o guide.ps -OUTPUT guide.ps -WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +DEPENDS ${EVTGEN_DOC_SOURCES} +WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) +ADD_CUSTOM_TARGET(GUIDE ALL DEPENDS guide.ps) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/guide.ps DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) else() MESSAGE(STATUS "EvtGen doc: some of the required programs were not found: LATEX=${LATEX} BIBTEX=${BIBTEX} MAKEINDEX=${MAKEINDEX} DVIPS=${DVIPS}. The documentation will not be generated.") endif() diff --git a/doc/guide.bib b/doc/guide.bib index 45d5e3f..90b4a62 100644 --- a/doc/guide.bib +++ b/doc/guide.bib @@ -1,299 +1,295 @@ @misc{Ryd97a,note={ A. Ryd, "Form Factor Measurements in B and D Decays", in Proceedings of the 2nd International Conference on B Physics and CP Violation, Honolulu, 1997. }} @misc{Ryd97b,note={ A. Ryd, "Form Factors in B and D Decays", Contributed to the 7th International Symposium on Heavy Flavor Physics, Santa Barbara, 1997. }} @misc{Ryd98a,note={ A. Ryd and D. Lange, "The EvtGen package for simulating particle decays", Contributed to the International Conference on Computing in High Energy Physics (CHEP'98), Chicago, 1998. }} @misc{Goity95a,note={ J.L. Goity and W. Roberts, Phys. Rev. {\bf D51} 3459-3477 (1995) }} @misc{Adler87,note={ J.Adler {\it et al.},(MARK III),Phys. Lett. {\bf B196}, 107 (1987).}} - -@misc{Adler87,note={ -J.Adler {\it et al.},(MARK III),Phys. Lett. {\bf B196}, 107 (1987).}} - @misc{Akers95,note={ R. Akers {\it et al.}, (OPAL), ``A study of Charm Meson Production in Semileptonic B Decays'', CERN Preprint No. CERN-PPE/95-02 (1995) (unpublished).}} @misc{Albrecht89,note={ H. Albrecht {\it et al.}, (ARGUS), Nucl. Inst. Meth. {\bf A275}, 1 (1989).}} @misc{Albrecht93,note={ H. Albrecht {\it et al.}, (ARGUS), Z. Phys. {\bf C57}, 533 (1993).}} @misc{Altarelli82,note={ G. Altarrelli {\it et al.}, Nucl. Phys. {\bf B208}, 365 (1982).}} @misc{Anjos90,note={ J.C. Anjos {\it et al.}, (E691), Phys. Rev. Lett. {\bf 65}, 2630 (1990).}} @misc{Anjos93,note={ J.C. Anjos {\it et al.}, (E691), Phys. Rev. {\bf D48}, 56 (1993).}} @misc{Avery94,note={ P. Avery {\it et al.}, (CLEO), Phys. Lett. {\bf B331}, 236 (1994).}} @misc{Barish95,note={ B. Barish {\it et al.}, (CLEO), Phys. Rev. {\bf D51}, 1014 (1995).}} @misc{Barish96,note={ B. Barish {\it et al.}, (CLEO), Phys. Rev. Lett. {\bf 76}, 1570 (1996).}} @misc{Bonn71,note={ I have lost this reference... }} @misc{Booth94,note={ S.P.~Booth, {{\it et al.}}\ (UKQCD), Phys.~Rev.~Lett.~{\bf 72}, 462 (1994); C.~Bernard, Y.~Shen, and A.~Soni, Phys.~Lett.~B {\bf 317}, 164 (1993); B.~Blok and M.~Shifman, Phys.~Rev.~D {\bf 47}, 2949 (1993); other predictions are summarized in Ref.~\cite{Richman95}.}} @misc{Buskulic95,note={ D. Buskulic {\it et al.}, (ALEPH), Phys. Lett. {\bf B345}, 103 (1995).}} @misc{Close94,note={ F.E. Close and A. Wambach, Nucl. Phys. {\bf B412}, 169 (1994).}} @misc{Duni91,note={ I. Dunietz, H. Quinn, A. Snyder, W Toki, and H.J. Lipkin, Phys. Rev. {\bf D43}, 2193 (1991).}} @misc{Dubo96,note={ J.E. Duboscq {\it et al.}, (CLEO) Phys. Rev. LEtt. {\bf 76}, 3898 (1996).}} @misc{Cap98,note={ I. Caprini {\it et al.}, Nucl.~Phys.~B~{\bf 530}, 153 (1998).}} @misc{Abe02,note={ K. Abe {\it et al.}, (Belle) Phys.~Lett.~B~{\bf 526}, 247 (2002).}} @misc{Aliev97,note={ T.M. Aliev, M. Savci and A. Ozpineci, Phys. Rev. {\bf D56}, 4260 (1997).}} @misc{Colangelo96,note={ P.Colangelo, F. De Fazio, P. Santorelli and E. Scrimieri Phys. Rev. {\bf D53}, 3672 (1996).}} @misc{Eadi88,note={ See W.T. Eadie {\it et al.}, {\it Statistical Methods in Experimental Physics}, Elsevier, New York (1988).}} @misc{Fox78,note={ G.C. Fox and S. Wolfram, Phys. Rev. Lett. {\bf 41}, 1581 (1978).}} @misc{Gilman90,note={ F.J. Gilman and R.L. Singleton, Phys. Rev. {\bf D41}, 142 (1990).}} @misc{Gangof4,note={ Gangof4. }} @misc{AlephRho,note={ The ALEPH collaboration, {\bf CERN-PPE/97013}}} @misc{3piNote,note={ S. Versill\'e, F. Le Diberder, {CP-Fitting of $B \rightarrow 3\pi$ events (BaBar Note in preparation)}}} @misc{3piBook,note={ $3\pi$ section of the BaBar Book}} @misc{AliGreub,note={ A.Ali and C.Greub, Phys.~Lett.~B~{\bf 361}, 146 (1995).}} @misc{KaganNeubert,note={ A.Kagan and M.Neubert, Euro.~Phys.~Jour~{\bf 7}, 5 1999.}} @misc{Isgur89a,note={ N. Isgur, D. Scora, B. Grinstein, and M.B. Wise, Phys. Rev. {\bf D39}, 799 (1989).}} @misc{Isgur89b,note={ N. Isgur and M.B. Wise, Phys. Lett. {\bf B232}, 113 (1989).}} @misc{Isgur90,note={ N. Isgur and M.B. Wise, Phys. Lett. {\bf B237}, 527 (1990).}} @misc{Jack64,note={ J. D. Jackson, in {\it Les Houches Lectures in High Energy Physics}, 1965 C. DeWitt and M. Jacob, eds. (Goordon and Breach, New York), 1966.}} @misc{Jaco59,note={ M. Jacob and G. C. Wick, Ann. Phys. {\bf 7}, 404 (1959).}} @misc{Korner88,note={ J.G. K\"orner and G.A. Schuler, Z. Phys. {\bf C38}, 511 (1988).}} @misc{Kubota92,note={ Y. Kubota {\it et al.}, (CLEO), Nucl. Instr. and Meth. {\bf A320}, 66 (1992).}} @misc{Lange96,note={ D. Lange and A. Ryd, CLEO Internal Note, CBX 96-6 CSN 95-345 (1996) (unpublished).}} @misc{Luke90,note={ M.E. Luke, Phys. Lett. {\bf B252}, 447 (1990).}} @misc{Menary92,note={ S. Menary, CLEO Internal Note, CBX 92-103 (1992) (unpublished).}} @misc{Neubert91,note={ M. Neubert, Phys. Lett. {\bf B264}, 455 (1991).}} @misc{Neubert92,note={ M. Neubert and V. Rieckert, Nucl. Phys. {\bf B382}, 97 (1992).}} @misc{Neubert93,note={ M. Neubert, Phys. Rep. {\bf 245}, 259 (1993).}} @misc{Renton90,note={ See P. Renton, {\it Electroweak Interactions}, Cambridge University, New York (1990).}} @misc{Rich84,note={ J.D. Richman, Cal. Tech. Preprint CALT-68-1148, (1984) (unpublished).}} @misc{Richman95,note={ J.D. Richman and P. Burchat, Rev. Mod. Phys. {\bf 67}, 893 (1995).}} @misc{Sanghera93,note={ S. Sanghera {\it et al.}, (CLEO), Phys. Rev. {\bf D47}, 791 (1993).}} @misc{Schmidt92,note={ D.M. Schmidt, ``Measurement of Charm Semileptonic Form Factors'', Ph. D. Thesis, University of California Santa Barbara (1992) (unpublished).}} @misc{Sakurai,notes={ J. J. Sakurai, {\it Modern Quantum Mechanics}, (Addison-Wesley Publishing Company, Inc.), (1985).}} @misc{Schmidt93,note={ D.M. Schmidt, R.M. Morrison, and M. Witherell, Nucl. Instr. and Meth. {\bf A328}, 547 (1993).}} @misc{Scora95,note={ D. Scora and N. Isgur, Phys. Rev. {\bf D52}, 2783 (1995).}} @misc{Voloshin92,note={ M.B. Voloshin, Phys. Rev. {\bf D46}, 3062 (1992).}} @misc{Wirbel85,note={ M. Wirbel {\it et al.}, Z. Phys. {\bf C29}, 637 (1985).}} @misc{Was92,note={ E. Richter-Was, Phys. Lett. {\bf B303}, 163, (1993). }} @misc{trksim,note={ TRKSIM is a fast Monte Carlo that uses measured efficiencies and resolutions to generate parametrized detector response for events.}} @misc{hadronic,note={ Hadronic events are identified as having atleast three charged tracks and 0.15 $E_{\rm cm}$ energy deposited in the calorimeter.}} @misc{CKM,note={ N. Cabibbo, Phys. Rev. Lett. {\bf 10}, 531 (1963); M. Kobayashi and T. Maskawa, Prog. Theor. Phys. {\bf 49}, 652 (1973).}} @misc{bdlnu,note={ CLEO Collaboration, CLEO-CONF-95-10, EPS0166 (1995).}} @misc{pdg,note={ Phys. Rev. D 50, 1253 (1994).}} @misc{pdgckm,note={ Phys. Rev. D 50, 1315 (1994) and references therein.}} @misc{Kutschke94,note={ R. Kutschke, CLEO Internal Note, CSN 94-334 (1992) (unpublished).}} @misc{Kutschke96a,note={ R. Kutschke and A. Ryd, CLEO Internal Note, CBX 96-XYZ (1996) (unpublished).}} @misc{geane,note={ Reference to the GEANE package.}} @misc{geant,note={ GEANT Detector Description and Simulation Tool, Version 3.15, CERN Program Library W5103, CERN (1993) (unpublished).}} @misc{Kutschke96b,note={ R. Kutschke and A.Ryd, CLEO Internal Note, CBX 96-20 (1996) (unpublished).}} @misc{Avery91,note={ P. Avery, CLEO Internal Note, CBX 91-74 (1991) (unpublished).}} @misc{Fruhwirth88,note={ R. Fruhwirth, HEPHY-PUB-516/88, ``Application of Filter Methods to the Reconstruction of Tracks and Vertices in Events of Experimental High Energy Physics'', Ph. D. Thesis (1988) (unpublished).}} @misc{Billoir83,note={ P. Billoir, Nucl. Instr. Meth. {\bf 225}, 352 (1983).}} @misc{Billoir90,note={ P. Billoir and S. Qian, Nucl. Instr. Meth. {\bf A225}, 219 (1990).}} @misc{Kalman61,note={ R.E. Kalman, J. Basic Eng. {\bf 82}, 34 (1961); R.E. Kalman and R.S. Bucy, ibid., 95 (1961).}} @misc{Avery92,note={ P. Avery, CLEO Internal Note, CBX 92-40 (1992) (unpublished).}} @misc{Jones96,note={ S.L. Jones, ``Semileptonic B Meson to Excited Charm Meson Decay'', Ph. D. Thesis, Cornell University (1996) (unpublished).}} @misc{Korchemsky00,note={ G.P.\ Korchemsky, D.\ Pirjol, and T. \ Yan, {\em Phys. Rev.\/} {\bf D61}, 114510 (2000).}} @misc{jetset,note={ T. Sj\"ostrand, Computer Physics Commun. {\bf 82} 74 (1994).}} @misc{qq,note={ See http://www.lns.cornell.edu/public/CLEO/soft/QQ. }} @misc{clhep,note={ What can be referenced for CLHEP? }} @misc{root,note={ http://root.cern.ch/ }} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e78aaec..058eedc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,181 +1,181 @@ # Use glob to find the sources for the main and external libraries file(GLOB EVTGEN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/EvtGenBase/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/EvtGenModels/*.cpp ) file(GLOB EVTGEN_EXTERNAL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/EvtGenExternal/*.cpp ) # Add the main EvtGen library... add_library(objlib OBJECT ${EVTGEN_SOURCES}) set_target_properties(objlib PROPERTIES POSITION_INDEPENDENT_CODE 1) target_include_directories(objlib PRIVATE ${CMAKE_SOURCE_DIR}) target_compile_definitions(objlib PRIVATE EVTGEN_CPP11) if (EVTGEN_HEPMC3) target_compile_definitions(objlib PRIVATE EVTGEN_HEPMC3) target_include_directories(objlib PRIVATE ${HEPMC3_INCLUDE_DIR}) else() target_include_directories(objlib PRIVATE ${HEPMC2_INCLUDE_DIR}) endif() add_library(EvtGen SHARED $) set_target_properties(EvtGen PROPERTIES OUTPUT_NAME EvtGen) set_target_properties(EvtGen PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} ) set_target_properties(EvtGen PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) target_include_directories(EvtGen PUBLIC $ $) if (EVTGEN_HEPMC3) target_include_directories(EvtGen PUBLIC ${HEPMC3_INCLUDE_DIR}) target_link_libraries(EvtGen ${HEPMC3_LIB} ${HEPMC3_SEARCH_LIB} ) else() target_include_directories(EvtGen PUBLIC ${HEPMC2_INCLUDE_DIR}) target_link_libraries(EvtGen ${HEPMC2_LIBRARIES}) endif() target_compile_definitions(EvtGen PUBLIC EVTGEN_CPP11) add_library(EvtGenStatic STATIC $) set_target_properties(EvtGenStatic PROPERTIES OUTPUT_NAME EvtGen) set_target_properties(EvtGenStatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/archive) target_include_directories(EvtGenStatic PUBLIC $ $) if (EVTGEN_HEPMC3) target_include_directories(EvtGenStatic PUBLIC ${HEPMC3_INCLUDE_DIR}) target_link_libraries(EvtGenStatic ${HEPMC3_LIB} ${HEPMC3_SEARCH_LIB} ) else() target_include_directories(EvtGenStatic PUBLIC ${HEPMC2_INCLUDE_DIR}) target_link_libraries(EvtGenStatic ${HEPMC2_LIBRARIES}) endif() target_compile_definitions(EvtGenStatic PUBLIC EVTGEN_CPP11) # Add the EvtGenExternal library... if( ${EVTGEN_PYTHIA} OR ${EVTGEN_PHOTOS} OR ${EVTGEN_TAUOLA} ) add_library(objlib_ext OBJECT ${EVTGEN_EXTERNAL_SOURCES}) set_target_properties(objlib_ext PROPERTIES POSITION_INDEPENDENT_CODE 1) target_include_directories(objlib_ext PRIVATE ${CMAKE_SOURCE_DIR}) if (EVTGEN_HEPMC3) target_include_directories(objlib_ext PUBLIC ${HEPMC3_INCLUDE_DIR}) target_compile_definitions(objlib_ext PRIVATE EVTGEN_HEPMC3) else() target_include_directories(objlib_ext PUBLIC ${HEPMC2_INCLUDE_DIR}) endif() target_compile_definitions(objlib_ext PRIVATE EVTGEN_CPP11) if(${EVTGEN_PYTHIA}) target_include_directories(objlib_ext PRIVATE ${PYTHIA8_INCLUDE_DIRS}) target_compile_definitions(objlib_ext PRIVATE EVTGEN_PYTHIA) endif() if(${EVTGEN_PHOTOS}) target_include_directories(objlib_ext PRIVATE ${Photos++_INCLUDE_DIRS}) target_compile_definitions(objlib_ext PRIVATE EVTGEN_PHOTOS) endif() if(${EVTGEN_TAUOLA}) target_include_directories(objlib_ext PRIVATE ${Tauola++_INCLUDE_DIRS}) target_compile_definitions(objlib_ext PRIVATE EVTGEN_TAUOLA) endif() add_library(EvtGenExternal SHARED $) set_target_properties(EvtGenExternal PROPERTIES OUTPUT_NAME EvtGenExternal) set_target_properties(EvtGenExternal PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} ) set_target_properties(EvtGenExternal PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) if(${EVTGEN_PYTHIA}) target_link_libraries(EvtGenExternal ${PYTHIA8_LIBRARIES}) endif() if (EVTGEN_HEPMC3) target_link_libraries(EvtGenExternal ${HEPMC3_LIB} ${HEPMC3_SEARCH_LIB} ) if(${EVTGEN_PHOTOS}) target_link_libraries(EvtGenExternal ${Photos++_pp_LIBRARY} ${Photos++_ppHepMC3_LIBRARY} ) endif() if(${EVTGEN_TAUOLA}) target_link_libraries(EvtGenExternal ${Tauola++_CxxInterface_LIBRARY} ${Tauola++_Fortran_LIBRARY} ${Tauola++_HepMC3_LIBRARY}) endif() else() target_link_libraries(EvtGenExternal ${HEPMC2_LIBRARIES}) if(${EVTGEN_PHOTOS}) #Photos should always have ppHepMC for compilation with HepMC2 if (Photos++_pp_FOUND AND Photos++_ppHepMC_FOUND ) message(STATUS "EvtGen: PHOTOS has pp and ppHepMC components") target_link_libraries(EvtGenExternal ${Photos++_pp_LIBRARY} ${Photos++_ppHepMC_LIBRARY}) else() if(Photos++_CxxInterface_FOUND AND Photos++_Fortran_FOUND ) message(STATUS "EvtGen: PHOTOS has CxxInterface and Fortran components") target_link_libraries(EvtGenExternal ${Photos++_CxxInterface_LIBRARY} ${Photos++_Fortran_LIBRARY}) else() message(ERROR "EvtGen: PHOTOS lacks pp+ppHepMC or CxxInterface+Fortran components") endif() endif() endif() if(${EVTGEN_TAUOLA}) target_link_libraries(EvtGenExternal ${Tauola++_CxxInterface_LIBRARY} ${Tauola++_Fortran_LIBRARY}) #The old versions of Tauola don't have HepMC, the HepMC2 interface is in CxxInterface if (Tauola++_HepMC_FOUND) target_link_libraries(EvtGenExternal ${Tauola++_HepMC_LIBRARY}) endif() endif() endif() add_library(EvtGenExternalStatic STATIC $) set_target_properties(EvtGenExternalStatic PROPERTIES OUTPUT_NAME EvtGenExternal) set_target_properties(EvtGenExternalStatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/archive) if(${EVTGEN_PYTHIA}) target_link_libraries(EvtGenExternalStatic ${PYTHIA8_LIBRARIES}) endif() if (EVTGEN_HEPMC3) target_link_libraries(EvtGenExternalStatic ${HEPMC3_LIB} ${HEPMC3_SEARCH_LIB} ) if(${EVTGEN_PHOTOS}) target_link_libraries(EvtGenExternalStatic ${Photos++_pp_LIBRARY} ${Photos++_ppHepMC3_LIBRARY}) endif() if(${EVTGEN_TAUOLA}) target_link_libraries(EvtGenExternalStatic ${Tauola++_CxxInterface_LIBRARY} ${Tauola++_Fortran_LIBRARY} ${Tauola++_HepMC3_LIBRARY}) endif() else() if(${EVTGEN_PHOTOS}) if (Photos++_pp_FOUND AND Photos++_ppHepMC_FOUND ) message(STATUS "EvtGen: PHOTOS has pp and ppHepMC components") target_link_libraries(EvtGenExternal ${Photos++_pp_LIBRARY} ${Photos++_ppHepMC_LIBRARY}) else() if(Photos++_CxxInterface_FOUND AND Photos++_Fortran_FOUND ) message(STATUS "EvtGen: PHOTOS has CxxInterface and Fortran components") target_link_libraries(EvtGenExternal ${Photos++_CxxInterface_LIBRARY} ${Photos++_Fortran_LIBRARY}) else() message(ERROR "EvtGen: PHOTOS lacks pp+ppHepMC or CxxInterface+Fortran components") endif() endif() endif() if(${EVTGEN_TAUOLA}) target_link_libraries(EvtGenExternalStatic ${Tauola++_CxxInterface_LIBRARY} ${Tauola++_Fortran_LIBRARY}) if (Tauola++_HepMC_FOUND) target_link_libraries(EvtGenExternalStatic ${Tauola++_HepMC_LIBRARY} ) endif() endif() target_link_libraries(EvtGenExternalStatic ${HEPMC2_LIBRARIES}) endif() endif() # Install the libraries install( TARGETS EvtGen EvtGenStatic EXPORT "EvtGenTargets" LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/archive + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( ${EVTGEN_PYTHIA} OR ${EVTGEN_PHOTOS} OR ${EVTGEN_TAUOLA} ) install( TARGETS EvtGenExternal EvtGenExternalStatic EXPORT "EvtGenTargets" LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/archive + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif()