Skip to content
Snippets Groups Projects
CMakeLists.txt 2.18 KiB
Newer Older
  • Learn to ignore specific revisions
  • ################################################################################
    ## CMAKE Settings
    ################################################################################
    set (EXE "pythia6m")
    set (TARGETS ${TARGETS} ${EXE} PARENT_SCOPE)
    
    
    ################################################################################
    ## Sources and install headers
    ################################################################################
    set (SOURCES "pythia6m.cc")
    
    set (DATA "example-config.json")
    
    
    ################################################################################
    ## Include directories
    ################################################################################
    include_directories("${PROJECT_SOURCE_DIR}")
    include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
    
    ################################################################################
    ## External Libraries
    ################################################################################
    ## ROOT
    find_package(ROOT REQUIRED)
    include_directories(${ROOT_INCLUDE_DIR})
    ## boost
    find_package(Boost COMPONENTS program_options filesystem system REQUIRED)
    include_directories(${Boost_INCLUDE_DIRS})
    ## nanocernlib
    find_package(nanocernlib REQUIRED)
    
    ################################################################################
    ## Compile and Link
    ################################################################################
    add_executable(${EXE} ${SOURCES})
    target_link_libraries(${EXE} 
    
      pythia6m_core
      pythia6m_interface
    
      pythia6m_fmotion
      pythia6m_gmc
    
      pythia6m_radiator
    
      pythia6m_radgen
    
      pythia6m_pythia
    
      pythia6m_core
    
      pythia6m_interface
    
      pythia6m_fmotion
      pythia6m_gmc
    
      pythia6m_radiator
    
      pythia6m_radgen
    
      pythia6m_pythia
    
      ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${NANOCERNLIB_LIBRARIES})
    set_target_properties(${EXE} PROPERTIES VERSION ${PYTHIA6M_VERSION})
    
    ################################################################################
    ## Export and Install
    ################################################################################
    install(TARGETS ${EXE}
      EXPORT ${PROJECT_NAME}-targets
      RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)
    
    install(FILES ${DATA} DESTINATION "${INSTALL_SHARE_DIR}" COMPONENT exe)