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
0008 # Set version based on git
0009 include(cmake/git_version.cmake)
0010 set_git_version(HEPMC_MERGER_VERSION)
0011
0012 project(SignalBackgroundMerger VERSION ${HEPMC_MERGER_VERSION} LANGUAGES CXX)
0013
0014 ## This enables us to use CMAKE_INSTALL_FULL_DATADIR in the code
0015 ## (should resolve to ${CMAKE_INSTALL_PREFIX}/share)
0016 include(GNUInstallDirs)
0017 add_definitions(-DCMAKE_INSTALL_FULL_DATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
0018 ## Also hand over the source directory for people who don't do make install
0019 add_definitions(-DCMAKE_PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
0020
0021 #----------------------------------------------------------------------------
0022 # Find HepMC3
0023 message ( "---- You can specify a HepMC3 installation using \"-DHepMC3=[path/to/lib]\" " )
0024 # message ( "---- HepMC3=" ${HepMC3} )
0025 find_package(HepMC3 3.2.6 REQUIRED HINTS ${HepMC3} ${HepMC3_DIR} )
0026 message ( "-- HepMC3 library found at ${HEPMC3_LIB}" )
0027 # message ( "-- HepMC3 headers found in ${HEPMC3_INCLUDE_DIR}" )
0028
0029
0030 #----------------------------------------------------------------------------
0031 # Find root, for hepmc.root format
0032 find_package(ROOT 6.20 CONFIG REQUIRED)
0033
0034 #----------------------------------------------------------------------------
0035 set(sources ${PROJECT_SOURCE_DIR}/SignalBackgroundMerger.cpp )
0036 # file( headers )
0037
0038 #----------------------------------------------------------------------------
0039 # Add the executable, and link it to external libraries
0040 #
0041 add_executable(SignalBackgroundMerger ${sources})
0042 target_compile_definitions(
0043 SignalBackgroundMerger PRIVATE HEPMC_MERGER_VERSION_FULL=${HEPMC_MERGER_VERSION_FULL})
0044 target_compile_features(SignalBackgroundMerger PUBLIC cxx_std_17)
0045 target_link_libraries(SignalBackgroundMerger ROOT::Tree ROOT::RIO ROOT::Core ROOT::Hist HepMC3::HepMC3 HepMC3::rootIO )
0046 target_include_directories(SignalBackgroundMerger
0047 PRIVATE
0048 ${HEPMC3_INCLUDE_DIR}
0049 )
0050
0051
0052 #----------------------------------------------------------------------------
0053 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0054 #
0055 install(TARGETS SignalBackgroundMerger
0056 EXPORT SignalBackgroundMerger-export
0057 DESTINATION bin)
0058
0059 #----------------------------------------------------------------------------
0060 ## Generate and install cmake configuration file
0061 install(EXPORT SignalBackgroundMerger-export
0062 FILE
0063 SignalBackgroundMerger.cmake
0064 NAMESPACE
0065 SignalBackgroundMerger::
0066 DESTINATION
0067 cmake
0068 )
0069
0070
0071