Commit bb556d8c authored by Kevin Funk's avatar Kevin Funk

Fix compilation on CentOS 6

Summary:
Issue:
```
processui/CMakeFiles/processui.dir/ProcessModel.cpp.o: In function
`TimeUtil::systemUptimeSeconds()':
ProcessModel.cpp:(.text._ZN8TimeUtil19systemUptimeSecondsEv[_ZN8TimeUtil19systemUptimeSecondsEv]+0x15):
undefined reference to `clock_gettime'
```

Reviewers: jriddell, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5955
parent 8dd5f001
......@@ -41,8 +41,11 @@ include(ECMAddTests)
include(ECMInstallIcons)
include(ECMPackageConfigHelpers)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(ECMSetupVersion)
check_library_exists(c clock_gettime "time.h" HAVE_CLOCK_GETTIME_C)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX KSYSGUARD
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksysguard_version.h"
......
......@@ -58,6 +58,10 @@ if(Qt5WebKitWidgets_FOUND)
target_link_libraries(processui PRIVATE Qt5::WebKitWidgets)
endif()
if(NOT HAVE_CLOCK_GETTIME_C)
target_link_libraries(processui PRIVATE rt)
endif()
set_target_properties(processui
PROPERTIES VERSION ${KSYSGUARD_VERSION_STRING}
SOVERSION ${KSYSGUARD_SOVERSION}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment