-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
42 lines (31 loc) · 1.01 KB
/
CMakeLists.txt
File metadata and controls
42 lines (31 loc) · 1.01 KB
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
cmake_minimum_required (VERSION 3.18)
project(LiTL
VERSION 0.2.0
LANGUAGES C
DESCRIPTION "LiTL is a tracing library"
HOMEPAGE_URL https://github.com/trahay/LiTL
)
# include CMake modules
include(CheckLibraryExists)
option(ENABLE_GETTID
"Use syscall(SYS_gettid) to get the thread ID instead of pthread_self(). This however costs a system call for each trace entry"
OFF)
option(FORCE_32BITS
"Build LiTL in 32-bit mode"
OFF)
CHECK_LIBRARY_EXISTS(rt clock_gettime "" librt_exist)
if (NOT librt_exist)
message(FATAL_ERROR "librt was not found.")
endif()
CHECK_LIBRARY_EXISTS(m ceil "" libm_exist)
if (NOT libm_exist)
message(FATAL_ERROR "libm was not found.")
endif()
set (INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
# Subdirectory
add_subdirectory (src)
add_subdirectory (utils)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/litl.pc.in
${CMAKE_CURRENT_BINARY_DIR}/litl.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/litl.pc
DESTINATION "${INSTALL_PKGCONFIG_DIR}")