-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
52 lines (36 loc) · 1.66 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
project(scorep_plugin_nvml)
cmake_minimum_required(VERSION 3.10)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Intialize git submodules if not done already
include(cmake/GitSubmoduleUpdate.cmake)
git_submodule_update()
# Find dependencies
find_package(NVML REQUIRED)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(NITRO_POSITION_INDEPENDENT_CODE ON CACHE INTERNAL "Whether to build Nitro libraries with position independent code")
add_subdirectory(lib/scorep_plugin_cxx_wrapper)
# nvml_plugin
add_library(nvml_plugin MODULE src/nvml_plugin.cpp)
target_compile_features(nvml_plugin PUBLIC cxx_std_14)
target_link_libraries(nvml_plugin PUBLIC Scorep::scorep-plugin-cxx ${NVML_LIBRARIES})
target_include_directories(nvml_plugin PUBLIC include ${NVML_INCLUDE_DIRS})
#nvml_sync_plugin
add_library(nvml_sync_plugin MODULE src/nvml_sync_plugin.cpp)
target_compile_features(nvml_sync_plugin PUBLIC cxx_std_14)
target_link_libraries(nvml_sync_plugin PUBLIC Scorep::scorep-plugin-cxx ${NVML_LIBRARIES})
target_include_directories(nvml_sync_plugin PUBLIC include ${NVML_INCLUDE_DIRS})
#nvml_sampling_plugin
add_library(nvml_sampling_plugin MODULE src/nvml_sampling_plugin.cpp)
target_compile_features(nvml_sampling_plugin PUBLIC cxx_std_14)
target_link_libraries(nvml_sampling_plugin PUBLIC Scorep::scorep-plugin-cxx ${NVML_LIBRARIES})
target_include_directories(nvml_sampling_plugin PUBLIC include ${NVML_INCLUDE_DIRS})
install(TARGETS nvml_plugin
LIBRARY DESTINATION lib
)
install(TARGETS nvml_sync_plugin
LIBRARY DESTINATION lib
)
install(TARGETS nvml_sampling_plugin
LIBRARY DESTINATION lib
)