Skip to content
Snippets Groups Projects
CMakeLists.txt 2.18 KiB
Newer Older
#==========================================================================
Markus Frank's avatar
Markus Frank committed
#  AIDA Detector description implementation 
#--------------------------------------------------------------------------
# Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
# All rights reserved.
#
# For the licensing terms see $DD4hepINSTALL/LICENSE.
# For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
#
#==========================================================================
Christoph Hombach's avatar
Christoph Hombach committed
#
# Simple CMakeList.txt file that allows to
Markus Frank's avatar
Markus Frank committed
# build all dd4hep examples in one go, e.g.
Markus Frank's avatar
Markus Frank committed
# . ./bin/thisdd4hep.sh
Christoph Hombach's avatar
Christoph Hombach committed
# cd examples ;
# mkdir build ; cd build
# cmake ..
#
# F.Gaede, DESY, 2013
# 
# M.Frank, CERN, 2015:  Adapt to new cmake scripts
#==========================================================================
Marko Petric's avatar
Marko Petric committed
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)

project( DD4hep_Examples )

Frank Gaede's avatar
Frank Gaede committed
option(BUILD_TESTING "Enable and build tests" ON)
Marko Petric's avatar
Marko Petric committed
option(CMAKE_MACOSX_RPATH "Build with rpath on macos" ON)
Markus Frank's avatar
Markus Frank committed
find_package ( DD4hep REQUIRED )
include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
include ( ${DD4hep_DIR}/cmake/DD4hepBuild.cmake )
#
find_package ( ROOT REQUIRED COMPONENTS Geom GenVector )
include(${ROOT_USE_FILE})
#
dd4hep_set_compiler_flags()
SET( ENV{DD4hepExamplesINSTALL} ${CMAKE_INSTALL_PREFIX} )
Markus Frank's avatar
Markus Frank committed
dd4hep_configure_output()
Markus Frank's avatar
Markus Frank committed
dd4hep_package ( dd4hepExample MAJOR 0 MINOR 15 PATCH 0 
  USES           [ROOT REQUIRED COMPONENTS Geom GenVector] 
Markus Frank's avatar
Markus Frank committed
                 [dd4hep REQUIRED COMPONENTS DDCore]
  )
#
# XercesC dependent stuff
if ( DD4HEP_USE_XERCESC )
  dd4hep_print("|++> XercesC PRESENT. Building DDDB examples.")
  dd4hep_enable_tests (DDDB)
  dd4hep_enable_tests (DDCodex)
else()
  dd4hep_print("|++> XercesC is not present. NOT building DDDB examples.")
endif()
#
# CLHEP dependent stuff:
find_package (CLHEP QUIET)
string(FIND "${CLHEP_DIR}" "NOTFOUND" HaveDDCMS)
if ( NOT ${HaveDDCMS} GREATER 0 )
  dd4hep_print("|++> XercesC PRESENT. Building DDCMS examples.")
  dd4hep_enable_tests (DDCMS)
else()
  dd4hep_print("|++> CLHEP is not present. NOT building DDCMS examples.")
endif()