| 1 |
# FindRT.cmake - Try to find the RT library |
| 2 |
# Once done this will define |
| 3 |
# |
| 4 |
# RT_FOUND - System has rt |
| 5 |
# RT_INCLUDE_DIR - The rt include directory |
| 6 |
# RT_LIBRARIES - The libraries needed to use rt |
| 7 |
# RT_DEFINITIONS - Compiler switches required for using rt |
| 8 |
# |
| 9 |
# Also creates an import target called RT::RT |
| 10 |
|
| 11 |
find_path (RT_INCLUDE_DIR NAMES time.h |
| 12 |
PATHS |
| 13 |
/usr |
| 14 |
/usr/local |
| 15 |
/opt |
| 16 |
PATH_SUFFIXES |
| 17 |
) |
| 18 |
|
| 19 |
find_library(RT_LIBRARIES NAMES rt |
| 20 |
PATHS |
| 21 |
/usr |
| 22 |
/usr/local |
| 23 |
/opt |
| 24 |
) |
| 25 |
|
| 26 |
include(FindPackageHandleStandardArgs) |
| 27 |
|
| 28 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(rt DEFAULT_MSG RT_LIBRARIES RT_INCLUDE_DIR) |
| 29 |
|
| 30 |
mark_as_advanced(RT_INCLUDE_DIR RT_LIBRARIES) |
| 31 |
|
| 32 |
if (NOT TARGET RT::RT) |
| 33 |
add_library(RT::RT INTERFACE IMPORTED) |
| 34 |
|
| 35 |
set_target_properties(RT::RT PROPERTIES |
| 36 |
INTERFACE_INCLUDE_DIRECTORIES ${RT_INCLUDE_DIR} |
| 37 |
INTERFACE_LINK_LIBRARIES ${RT_LIBRARIES} |
| 38 |
) |
| 39 |
endif() |