From f01bab6633c170315f2a7d1aee71a46e122a4b0b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 23 Jan 2013 14:31:02 -0500 Subject: [PATCH] Fix cmake not linking librt to perf-tools --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f80cbdc..c43507b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,8 @@ check_library_exists(ws2 printf "" HAVE_WS2) check_library_exists(rpcrt4 printf "" HAVE_RPCRT4) # UuidCreateSequential check_library_exists(iphlpapi printf "" HAVE_IPHLAPI) # GetAdaptersAddresses +find_library(RT_LIBRARY rt) + find_package(Threads) @@ -541,6 +543,10 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Why? add_executable(${perf-tool} perf/${perf-tool}.cpp) target_link_libraries(${perf-tool} libzmq) + if(RT_LIBRARY) + target_link_libraries(${perf-tool} ${RT_LIBRARY}) + endif() + if(ZMQ_BUILD_FRAMEWORK) # Copy perf-tools binaries into Framework add_custom_command(