Skip to content
Snippets Groups Projects
Commit c4f45d4c authored by Andre Sailer's avatar Andre Sailer
Browse files

Changes to DD4hepConfig.cmake

Split libraries into DDCore and DDComponents.
One has to explicitely specify the required components in find_package.
See doc/release.notes for more details
parent c9790263
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ endfunction()
# calls all the function/includes/configurations that are needed to be done to create dd4hep plugins
#---------------------------------------------------------------------------------------------------
function ( dd4hep_instantiate_package PackageName )
MESSAGE (STATUS "instantiating the dd4hep package ${PackageName}" )
MESSAGE (STATUS "Instantiating the DD4hep package ${PackageName}" )
IF ( NOT ${DD4hep_FOUND} )
MESSAGE ( FATAL "DD4HEP was not found" )
......
......@@ -50,19 +50,30 @@ INCLUDE( ${DD4hep_ROOT}/cmake/DD4hepMacros.cmake )
# additional components are set by cmake in variable PKG_FIND_COMPONENTS
# first argument should be the package name
if(@DD4HEP_USE_GEANT4@)
CHECK_PACKAGE_LIBS(DD4hep DDCore DDSegmentation DDRec DDG4)
#--- if geant 4 was built with CLHEP we need to export this to client packages
if( @GEANT4_USE_CLHEP@)
set(GEANT4_USE_CLHEP 1 )
endif()
set( Geant4_DIR @Geant4_DIR@)
set(Geant4_DIR @Geant4_DIR@)
else()
CHECK_PACKAGE_LIBS(DD4hep DDCore DDSegmentation DDRec)
endif()
CHECK_PACKAGE_LIBS(DD4hep DDCore)
IF(DD4hep_FIND_COMPONENTS)
MESSAGE( STATUS "Looking for these Components ${DD4hep_FIND_COMPONENTS}" )
FOREACH(comp ${DD4hep_FIND_COMPONENTS})
#CHECK_PACKAGE_LIBS is looking for components too, just need to check if they were found, if requested
STRING( TOUPPER ${comp} _ulibname )
if(NOT DD4hep_${_ulibname}_FOUND)
MESSAGE(FATAL_ERROR "Did not find required component: ${comp}")
ENDIF()
ENDFOREACH()
ENDIF()
##---- build with Boost ?
#if(@DD4HEP_USE_BOOST@)
......
......@@ -4,6 +4,15 @@ DD4hep ---- Release Notes
=================================
2015/05/11 Andre Sailer
-----------------------
- CMake updates:
- Split libraries into components: use find_package(DD4hep COMPONENTS <component> [...] )
to find the components you need.
- At the moment there are these components are sensible to link against: DDRec, DDG4, DDEve, DDSegmentation
- To link against the librarie use either DD4hep_COMPONENT_LIBRARIES or DD4hep_<COMPONENT>_LIBRARY,
where <COMPONENT> needs to be replaced by the UPPER case name of the component
2015/05/09 Markus Frank
-----------------------
- Allow to access detectors by type from lcdd.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment