Debian Codegraph @

examples/BasicExamples/CMakeLists.txt

raw
1 # building tests
2 #------------------
3 cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
4 #
5
6 #---Add executables------------------------------------------------------------
7 if(HEPMC3_ENABLE_SEARCH)
8 if (WIN32)
9 message(STATUS "basic_tree.exe does not work Windows. DISABLED.")
10 else()
11 add_executable(basic_tree.exe ${CMAKE_CURRENT_SOURCE_DIR}/basic_tree.cc)
12 target_link_libraries(basic_tree.exe HepMC3 HepMC3search ${ROOT_LIBRARIES})
13 target_include_directories(basic_tree.exe PUBLIC ${CMAKE_SOURCE_DIR}/search/include)
14 set_target_properties(basic_tree.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/${CMAKE_INSTALL_BINDIR})
15 install(TARGETS basic_tree.exe DESTINATION ${CMAKE_INSTALL_BINDIR})
16 endif()
17 endif()
18
19 if(CMAKE_Fortran_COMPILER)
20 add_executable(hepevt_wrapper_example.exe ${CMAKE_CURRENT_SOURCE_DIR}/hepevt_wrapper_example_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/hepevt_wrapper_example_fortran.f)
21 target_link_libraries(hepevt_wrapper_example.exe HepMC3)
22 set_target_properties(hepevt_wrapper_example.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/${CMAKE_INSTALL_BINDIR})
23
24 install(TARGETS hepevt_wrapper_example.exe DESTINATION ${CMAKE_INSTALL_BINDIR})
25
26 else()
27 message(STATUS "No Fortran compiler - dissabling HepEvt example.")
28 endif()
29
30 add_executable(HepMC2_reader_example.exe ${CMAKE_CURRENT_SOURCE_DIR}/HepMC2_reader_example.cc)
31 target_link_libraries(HepMC2_reader_example.exe HepMC3 ${ROOT_LIBRARIES})
32 set_target_properties(HepMC2_reader_example.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/${CMAKE_INSTALL_BINDIR})
33
34 install(TARGETS HepMC2_reader_example.exe DESTINATION ${CMAKE_INSTALL_BINDIR})
35
36 add_executable(HepMC3_fileIO_example.exe ${CMAKE_CURRENT_SOURCE_DIR}/HepMC3_fileIO_example.cc)
37 target_link_libraries(HepMC3_fileIO_example.exe HepMC3 ${ROOT_LIBRARIES})
38 set_target_properties(HepMC3_fileIO_example.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/${CMAKE_INSTALL_BINDIR})
39
40 install(TARGETS HepMC3_fileIO_example.exe DESTINATION ${CMAKE_INSTALL_BINDIR})