-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathCMakeLists.txt
58 lines (51 loc) · 1.59 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
project(caliper-examples)
include_directories("../../src/interface/c_fortran")
set(CALIPER_CXX_EXAMPLE_APPS
async_event
cxx-example
cali-memtracking
cali-memtracking-macros
cali-perfproblem-branch-mispred
cali-functional
cali-regionprofile)
set(CALIPER_MPI_EXAMPLE_APPS
collective-output-channel)
set(CALIPER_C_EXAMPLE_APPS
c-example
cali-print-snapshot)
set(CALIPER_Fortran_EXAMPLE_APPS
fortran-example
fortran-regionprofile)
foreach(app ${CALIPER_CXX_EXAMPLE_APPS})
add_executable(${app} ${app}.cpp)
target_link_libraries(${app} caliper)
endforeach()
foreach(app ${CALIPER_C_EXAMPLE_APPS})
add_executable(${app} ${app}.c)
target_link_libraries(${app} caliper)
target_compile_features(${app} PRIVATE c_std_99)
set_target_properties(${app} PROPERTIES LINKER_LANGUAGE CXX)
endforeach()
if (CALIPER_HAVE_MPI)
foreach(app ${CALIPER_MPI_EXAMPLE_APPS})
add_executable(${app} ${app}.cpp)
set(examples_mpi_include_dirs
${MPI_CXX_INCLUDE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/../../mpi/include)
target_include_directories(${app} PRIVATE ${examples_mpi_include_dirs})
target_link_libraries(${app} caliper ${MPI_CXX_LIBRARIES})
endforeach()
endif()
if (WITH_FORTRAN)
foreach(app ${CALIPER_Fortran_EXAMPLE_APPS})
add_executable(${app} ${app}.f)
set_source_files_properties(${app}.f PROPERTIES Fortran_FORMAT FREE)
target_link_libraries(${app} caliper)
endforeach()
endif()
target_link_libraries(cali-memtracking
caliper-tools-util)
target_link_libraries(cali-memtracking-macros
caliper-tools-util)
target_link_libraries(async_event
Threads::Threads)