diff options
author | Volker Krause <volker.krause@kdab.com> | 2019-02-12 16:04:57 +0100 |
---|---|---|
committer | Volker Krause <volker.krause@kdab.com> | 2019-02-12 16:02:58 +0000 |
commit | cc8e2c45729a8e84beddc201f801dc23edfdd683 (patch) | |
tree | d4c0d134411adb301e6c87e84b0a1eed3cfa5c6c /cmake/FindWrapRt.cmake | |
parent | 1f965067489c59649b89eb2d0a32c74473d6cedd (diff) |
Use CMakePushCheckState
Change-Id: I58d779674363a7f7db4a7ea4ca4a9f4a9e271798
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/FindWrapRt.cmake')
-rw-r--r-- | cmake/FindWrapRt.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake index 221399b259..dee41e0617 100644 --- a/cmake/FindWrapRt.cmake +++ b/cmake/FindWrapRt.cmake @@ -1,8 +1,9 @@ include(CheckCXXSourceCompiles) +include(CMakePushCheckState) find_library(LIBRT rt) -set(_libraries "${CMAKE_REQUIRED_LIBRARIES}") +cmake_push_check_state() if(LIBRT_FOUND) list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBRT}") endif() @@ -15,8 +16,7 @@ int main(int argc, char *argv[]) { timespec ts; clock_gettime(CLOCK_REALTIME, &ts); }" HAVE_GETTIME) -set(CMAKE_REQUIRED_LIBRARIES "${_libraries}") -unset(_libraries) +cmake_pop_check_state() add_library(WrapRt INTERFACE) if (LIBRT_FOUND) |