key4hep/k4SimDelphes

Duplicated find_package calls

Closed this issue · 2 comments

Minor issue, but with the framework branch I get this output (re-)running cmake:

-- C++ standard: 17
-- Looking for EvtGen ...
-- Looking for EVTGEN... - found /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/evtgen-01-07-00-fdpf25atghcyakyk6ilgkbdd7hkk42eo/lib
-- xml path: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/pythia8-8303-uwum425ziw4i3gxrhludqhcwlbw65qun/share/Pythia8/xmldoc
-- pythia8 version extracted: 303
-- xml path: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/pythia8-8303-uwum425ziw4i3gxrhludqhcwlbw65qun/share/Pythia8/xmldoc
-- pythia8 version extracted: 303
-- Looking for EvtGen ...
-- Looking for EVTGEN... - found /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/evtgen-01-07-00-fdpf25atghcyakyk6ilgkbdd7hkk42eo/lib
-- xml path: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/pythia8-8303-uwum425ziw4i3gxrhludqhcwlbw65qun/share/Pythia8/xmldoc
-- pythia8 version extracted: 303
-- Found ROOT: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/root-6.22.06-p6lo5zfnto46nnfzp2hj2clsuyffmjkx/cmake (found version 6.22.06)
-- Found Gaudi: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/gaudi-35.0-wcrxdxolxgxqwtx3w3rgnzjrbkoqlh3j/lib/cmake/Gaudi (found version 35.0)
-- Found ROOT: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/root-6.22.06-p6lo5zfnto46nnfzp2hj2clsuyffmjkx/cmake (found version 6.22.06)
-- Found Gaudi: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/gaudi-35.0-wcrxdxolxgxqwtx3w3rgnzjrbkoqlh3j/lib/cmake/Gaudi (found version 35.0)
-- Found ROOT: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/root-6.22.06-p6lo5zfnto46nnfzp2hj2clsuyffmjkx/cmake (found version 6.22.06)
-- Found Gaudi: /cvmfs/sw.hsf.org/spackages/linux-centos7-broadwell/gcc-8.3.0/gaudi-35.0-wcrxdxolxgxqwtx3w3rgnzjrbkoqlh3j/lib/cmake/Gaudi (found version 35.0)
-- Configuring done
-- Generating done

which could be streamlined.

I also get this in k4MarlinWrapper. I didn't look into it yet.

At least for k4SimDelphes we are actually calling find_package for different dependencies depending on some build options, e.g.

if(BUILD_PYTHIA_READER)
find_package(Pythia8 REQUIRED)
add_executable(DelphesPythia8_EDM4HEP src/DelphesPythia8_EDM4HEP.cpp)
target_include_directories(DelphesPythia8_EDM4HEP PRIVATE ${PYTHIA8_INCLUDE_DIRS})
target_link_libraries(DelphesPythia8_EDM4HEP DelphesEDM4HepConverter podio::podioRootIO ${PYTHIA8_LIBRARIES} ${DELPHES_LIBRARY})
install(TARGETS DelphesPythia8_EDM4HEP DESTINATION bin)
endif()
if(BUILD_EVTGEN_READER)
find_package(EvtGen REQUIRED)
find_package(Pythia8 REQUIRED)