File: FindRT.cmake

package info (click to toggle)
pigpio 1.78-1.1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 7,088 kB
  • sloc: ansic: 17,891; python: 4,232; sh: 741; cpp: 281; makefile: 135
file content (39 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (114)
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
# FindRT.cmake - Try to find the RT library
# Once done this will define
#
#  RT_FOUND - System has rt
#  RT_INCLUDE_DIR - The rt include directory
#  RT_LIBRARIES - The libraries needed to use rt
#  RT_DEFINITIONS - Compiler switches required for using rt
#
# Also creates an import target called RT::RT

find_path (RT_INCLUDE_DIR NAMES time.h
  PATHS
  /usr
  /usr/local
  /opt
  PATH_SUFFIXES
)

find_library(RT_LIBRARIES NAMES rt
  PATHS
  /usr
  /usr/local
  /opt
)

include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(rt DEFAULT_MSG RT_LIBRARIES RT_INCLUDE_DIR)

mark_as_advanced(RT_INCLUDE_DIR RT_LIBRARIES)

if (NOT TARGET RT::RT)
  add_library(RT::RT INTERFACE IMPORTED)

  set_target_properties(RT::RT PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES ${RT_INCLUDE_DIR}
    INTERFACE_LINK_LIBRARIES ${RT_LIBRARIES}
  )
endif()