[CMake] -lrt finder

Alexander Neundorf a.neundorf-work at gmx.net
Fri Sep 21 11:48:11 EDT 2012


On Thursday 20 September 2012, Davis Ford wrote:
> I'm building for Raspberry Pi - which is embedded Linux on Arm, distro
> is Debian-based.
> 
> I'm getting this linker error:
> 
> libzmq.a(libzmq_la-clock.o): In function `zmq::clock_t::now_us()':
> /home/pi/git/libzmq/src/clock.cpp:76: undefined reference to
> `clock_gettime'
> 
> I believe I need to add "-lrt", I tried to look through the list of
> Finder modules, but I can't seem to identify the right one -- if one
> exists.  What is the correct way to solve this?

Use something like check_function_exists(), if it doesn't, try again with 
using the rt library.

Alex


More information about the CMake mailing list