summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/FindWrapRt.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake
index d14b922062..0e57cadef5 100644
--- a/cmake/FindWrapRt.cmake
+++ b/cmake/FindWrapRt.cmake
@@ -5,6 +5,8 @@ if(TARGET WrapRt)
return()
endif()
+set(WrapRt_FOUND OFF)
+
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
@@ -25,10 +27,11 @@ int main(int argc, char *argv[]) {
cmake_pop_check_state()
-add_library(WrapRt INTERFACE IMPORTED)
-if (LIBRT_FOUND)
- target_link_libraries(WrapRt INTERFACE "${LIBRT}")
-endif()
-
-set(WrapRt_FOUND "${HAVE_GETTIME}")
+if(HAVE_GETTIME)
+ set(WrapRt_FOUND ON)
+ add_library(WrapRt INTERFACE IMPORTED)
+ if (LIBRT_FOUND)
+ target_link_libraries(WrapRt INTERFACE "${LIBRT}")
+ endif()
+endif()