-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
50 lines (32 loc) · 1.13 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
cmake_minimum_required(VERSION 3.10)
project(afterompt VERSION 0.2.0 DESCRIPTION "OMPT tool for generating Aftermath traces")
find_package(PkgConfig)
pkg_check_modules(LIBTRACE REQUIRED libaftermath-trace)
set(CMAKE_C_FLAGS_DEBUG "-g -fopenmp")
set(CMAKE_C_FLAGS_RELEASE "-fopenmp")
set(SOURCES
"src/afterompt.c"
"src/trace.c"
)
set(COMPILER_DEFS
""
)
if(TRACE_LOOPS)
set(COMPILER_DEFS "${COMPILER_DEFS} -DTRACE_LOOPS")
endif()
if(TRACE_TASKS)
set(COMPILER_DEFS "${COMPILER_DEFS} -DTRACE_TASKS")
endif()
if(TRACE_OTHERS)
set(COMPILER_DEFS "${COMPILER_DEFS} -DTRACE_OTHERS")
endif()
if(ALLOW_EXPERIMENTAL)
set(COMPILER_DEFS "${COMPILER_DEFS} -DALLOW_EXPERIMENTAL")
endif()
add_definitions(${COMPILER_DEFS})
link_directories(${LIBTRACE_LIBRARY_DIRS})
add_library(${CMAKE_PROJECT_NAME} SHARED ${SOURCES})
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${LIBTRACE_INCLUDE_DIRS})
target_link_libraries(${CMAKE_PROJECT_NAME} ${LIBTRACE_LIBRARIES})
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${PROJECT_SOURCE_DIR}/install)