Skip to content

Commit

Permalink
Improve check for a header file from DD4hep (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Jan 24, 2025
1 parent 915923d commit 3cd447f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,10 @@ if(NOT K4GEO_USE_LCIO)
message(STATUS "Use of LCIO is DISABLED, some detectors that depend on LCIO will not be built: ${lcio_sources}")
endif()

include(CheckIncludeFileCXX)
set(CMAKE_REQUIRED_LIBRARIES DD4hep::DDRec)
CHECK_INCLUDE_FILE_CXX(DDRec/DCH_info.h DCH_INFO_H_EXIST)
set(CMAKE_REQUIRED_LIBRARIES)
set(FILES_DEPENDINGON_DCH_INFO_H "DriftChamber_o1_v02.cpp" )

if(NOT DCH_INFO_H_EXIST)
list(FILTER sources EXCLUDE REGEX "${FILES_DEPENDINGON_DCH_INFO_H}")
message(WARNING "Subdetector ${FILES_DEPENDINGON_DCH_INFO_H} will not be built because header file DDRec/DCH_info.h was not found")
if(${DD4hep_VERSION} VERSION_LESS 1.29)
set(FILES_DEPENDINGON_DCH_INFO_H "DriftChamber_o1_v02.cpp" )
list(FILTER sources EXCLUDE REGEX "${FILES_DEPENDINGON_DCH_INFO_H}")
message(WARNING "Subdetector ${FILES_DEPENDINGON_DCH_INFO_H} will not be built because the current version of DD4hep does not ship with the header file DDRec/DCH_info.h")
endif()

find_package(EDM4HEP)
Expand Down

0 comments on commit 3cd447f

Please sign in to comment.