Skip to content
Snippets Groups Projects
DD4hepConfig.cmake.in 1.68 KiB
Newer Older
##############################################################################
# cmake configuration file for DD4hep
#
# returns following variables:
#
#   DD4hep_FOUND      : set to TRUE if DD4hep found
#   DD4hep_VERSION    : package version
#   DD4hep_ROOT       : path to this DD4hep installation
#   DD4hep_LIBRARIES  : list of DD4hep libraries
#   DD4hep_INCLUDE_DIRS  : list of paths to be used with INCLUDE_DIRECTORIES
#   DD4hep_LIBRARY_DIRS  : list of paths to be used with LINK_DIRECTORIES
#
# @author Jan Engels, Desy
##############################################################################

SET( DD4hep_ROOT "@CMAKE_INSTALL_PREFIX@" )
SET( DD4hep_VERSION "@DD4hep_VERSION@" )


# ---------- include dirs -----------------------------------------------------
# do not store find results in cache
SET( DD4hep_INCLUDE_DIRS DD4hep_INCLUDE_DIRS-NOTFOUND )
MARK_AS_ADVANCED( DD4hep_INCLUDE_DIRS )

FIND_PATH( DD4hep_INCLUDE_DIRS
	NAMES DD4hep/DD4hep.h
	PATHS ${DD4hep_ROOT}/include
	NO_DEFAULT_PATH
)



# ---------- libraries --------------------------------------------------------
# do not store find results in cache
SET( DD4hep_LIBRARY_DIRS ${DD4hep_ROOT}/lib )
SET( DD4hep_LIBRARIES DD4hep_LIBRARIES-NOTFOUND )
MARK_AS_ADVANCED( DD4hep_LIBRARY_DIRS DD4hep_LIBRARIES )

FIND_LIBRARY( DD4hep_LIBRARIES
	NAMES DD4hep
	PATHS ${DD4hep_LIBRARY_DIRS}
	NO_DEFAULT_PATH
)



# ---------- final checking ---------------------------------------------------
INCLUDE( FindPackageHandleStandardArgs )
# set DD4HEP_FOUND to TRUE if all listed variables are TRUE and not empty
FIND_PACKAGE_HANDLE_STANDARD_ARGS( DD4hep DEFAULT_MSG DD4hep_ROOT DD4hep_INCLUDE_DIRS DD4hep_LIBRARIES )

SET( DD4hep_FOUND ${DD4HEP_FOUND} )