Back to home page

EIC code displayed by LXR

 
 

    


Warning, /HEPMC_Merger/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #----------------------------------------------------------------------------
0002 # Setup the project
0003 cmake_minimum_required(VERSION 3.8)
0004 if(${CMAKE_VERSION} VERSION_LESS 3.12)
0005   cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
0006 endif()
0007 project(SignalBackgroundMerger VERSION 1.0)
0008 
0009 
0010 ## This enables us to use CMAKE_INSTALL_FULL_DATADIR in the code
0011 ## (should resolve to ${CMAKE_INSTALL_PREFIX}/share)
0012 include(GNUInstallDirs)
0013 add_definitions(-DCMAKE_INSTALL_FULL_DATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
0014 ## Also hand over the source directory for people who don't do make install
0015 add_definitions(-DCMAKE_PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
0016 
0017 #----------------------------------------------------------------------------
0018 # Find HepMC3
0019 message ( "---- You can specify a HepMC3 installation using \"-DHepMC3=[path/to/lib]\" " )
0020 # message ( "---- HepMC3=" ${HepMC3} )
0021 find_package(HepMC3 3.2.6 REQUIRED HINTS ${HepMC3} ${HepMC3_DIR} )
0022 message ( "-- HepMC3 library found at ${HEPMC3_LIB}" )
0023 # message ( "-- HepMC3 headers found in ${HEPMC3_INCLUDE_DIR}" )
0024 
0025 
0026 #----------------------------------------------------------------------------
0027 # Find root, for hepmc.root format
0028 find_package(ROOT 6.20 CONFIG REQUIRED)
0029 
0030 #----------------------------------------------------------------------------
0031 set(sources ${PROJECT_SOURCE_DIR}/SignalBackgroundMerger.cpp )
0032 # file( headers )
0033 
0034 #----------------------------------------------------------------------------
0035 # Add the executable, and link it to external libraries
0036 #
0037 add_executable(SignalBackgroundMerger ${sources})
0038 target_compile_features(SignalBackgroundMerger PUBLIC cxx_std_17)
0039 target_link_libraries(SignalBackgroundMerger ROOT::Tree ROOT::RIO ROOT::Core ROOT::Hist HepMC3::HepMC3 HepMC3::rootIO )
0040 target_include_directories(SignalBackgroundMerger
0041   PRIVATE
0042   ${HEPMC3_INCLUDE_DIR}
0043 )
0044 
0045   
0046 #----------------------------------------------------------------------------
0047 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0048 #
0049 install(TARGETS SignalBackgroundMerger
0050   EXPORT SignalBackgroundMerger-export
0051   DESTINATION bin)
0052 
0053 #----------------------------------------------------------------------------
0054 ## Generate and install cmake configuration file
0055 install(EXPORT SignalBackgroundMerger-export
0056   FILE
0057     SignalBackgroundMerger.cmake
0058   NAMESPACE
0059     SignalBackgroundMerger::
0060   DESTINATION
0061   cmake
0062   )
0063 
0064 
0065