1
0
Fork 0

properly add librt when clock_gettime is used

This commit is contained in:
Erik Hofman 2011-12-24 11:34:35 +01:00
parent 651ac57ab2
commit cbdd89493f
2 changed files with 18 additions and 0 deletions
src/Main
utils/GPSsmooth

View file

@ -85,7 +85,11 @@ target_link_libraries(fgfs
install(TARGETS fgfs RUNTIME DESTINATION bin) install(TARGETS fgfs RUNTIME DESTINATION bin)
check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
add_executable(metar metar_main.cxx) add_executable(metar metar_main.cxx)
if(HAVE_CLOCK_GETTIME)
target_link_libraries(metar rt)
endif(HAVE_CLOCK_GETTIME)
target_link_libraries(metar target_link_libraries(metar
${SIMGEAR_LIBRARIES} ${SIMGEAR_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}

View file

@ -1,4 +1,6 @@
check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
add_executable(GPSsmooth gps.cxx gps.hxx gps_main.cxx) add_executable(GPSsmooth gps.cxx gps.hxx gps_main.cxx)
add_executable(MIDGsmooth MIDG-II.cxx MIDG-II.hxx MIDG_main.cxx) add_executable(MIDGsmooth MIDG-II.cxx MIDG-II.hxx MIDG_main.cxx)
add_executable(UGsmooth add_executable(UGsmooth
@ -8,6 +10,10 @@ add_executable(UGsmooth
UGear_telnet.cxx UGear_telnet.cxx
UGear_telnet.hxx) UGear_telnet.hxx)
if(HAVE_CLOCK_GETTIME)
target_link_libraries(GPSsmooth rt)
endif(HAVE_CLOCK_GETTIME)
target_link_libraries(GPSsmooth target_link_libraries(GPSsmooth
${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARIES}
${PLIB_SG_LIBRARY} ${PLIB_SG_LIBRARY}
@ -17,6 +23,10 @@ target_link_libraries(GPSsmooth
${WINMM_LIBRARY} ${WINMM_LIBRARY}
) )
if(HAVE_CLOCK_GETTIME)
target_link_libraries(MIDGsmooth rt)
endif(HAVE_CLOCK_GETTIME)
target_link_libraries(MIDGsmooth target_link_libraries(MIDGsmooth
${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARIES}
${PLIB_SG_LIBRARY} ${PLIB_SG_LIBRARY}
@ -26,6 +36,10 @@ target_link_libraries(MIDGsmooth
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
) )
if(HAVE_CLOCK_GETTIME)
target_link_libraries(UGsmooth rt)
endif(HAVE_CLOCK_GETTIME)
target_link_libraries(UGsmooth target_link_libraries(UGsmooth
${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARIES}
${PLIB_SG_LIBRARY} ${PLIB_SG_LIBRARY}