Warning, /DD4hep/examples/Segmentation/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #==========================================================================
0002 # AIDA Detector description implementation
0003 #--------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 #
0010 #==========================================================================
0011 cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
0012
0013 IF(NOT TARGET DD4hep::DDCore)
0014 find_package ( DD4hep REQUIRED )
0015 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
0016 include ( ${DD4hep_DIR}/cmake/DD4hepBuild.cmake )
0017 dd4hep_configure_output()
0018 ENDIF()
0019
0020 dd4hep_set_compiler_flags()
0021 #==========================================================================
0022
0023 #---------------------------
0024 set( PackageName Segmentation )
0025 #---------------------------
0026
0027 # project version
0028 SET( ${PackageName}_VERSION_MAJOR 0 )
0029 SET( ${PackageName}_VERSION_MINOR 0 )
0030 SET( ${PackageName}_VERSION_PATCH 1 )
0031
0032 SET( ${PackageName}_VERSION "${${PackageName}_VERSION_MAJOR}.${${PackageName}_VERSION_MINOR}" )
0033 SET( ${PackageName}_SOVERSION "${${PackageName}_VERSION_MAJOR}.${${PackageName}_VERSION_MINOR}" )
0034
0035 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake )
0036 set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
0037 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
0038
0039 #------------- set the default installation directory to be the source directory
0040
0041 IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
0042 SET( CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE PATH
0043 "install prefix path - overwrite with -D CMAKE_INSTALL_PREFIX = ..."
0044 FORCE )
0045 MESSAGE(STATUS "CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX} - overwrite with -D CMAKE_INSTALL_PREFIX" )
0046 ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
0047
0048
0049
0050 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0051
0052
0053 find_package ( ROOT REQUIRED COMPONENTS Geom GenVector )
0054
0055 #-------------------------------------------------------------
0056
0057
0058 set(Segmentationexamples_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/Segmentation)
0059 #
0060 add_executable(SegmentationTest SegmentationTest.cpp)
0061 target_link_libraries(SegmentationTest DD4hep::DDCore)
0062 install(TARGETS SegmentationTest LIBRARY DESTINATION bin)
0063
0064
0065 #---- configure run environment ---------------
0066 dd4hep_configure_scripts(${PackageName} DEFAULT_SETUP WITH_TESTS)
0067
0068 #--- install target-------------------------------------
0069
0070 install(TARGETS ${PackageName} LIBRARY DESTINATION lib)
0071
0072 #-------------------------------------------------------
0073
0074 dd4hep_add_test_reg( Segmentation_Example_Test
0075 COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_Segmentation.sh"
0076 EXEC_ARGS SegmentationTest
0077 REGEX_PASS "Neighbours of system:1,barrel:0,module:5,layer:12,slice:0,x:10,y:-30:"
0078 REGEX_FAIL " ERROR ;EXCEPTION;Exception"
0079 )