File: CMakeLists.txt

package info (click to toggle)
litl 0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 576 kB
  • sloc: ansic: 3,407; makefile: 36; sh: 18
file content (42 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download
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}")