[CMake] Add -lrt at the end of link.txt

Cedric Doucet cedric.doucet at inria.fr
Tue Jan 7 10:38:38 EST 2014


Thank you very much for your answer.
I am sorry I am a beginner in cmake.
What does target represent and where can I find it in CMakeLists.txt?
Best regards,
Cédric Doucet


----- Mail original -----
> De: "Rolf Eike Beer" <eike at sf-mail.de>
> À: cmake at cmake.org
> Envoyé: Mardi 7 Janvier 2014 16:18:47
> Objet: Re: [CMake] Add -lrt at the end of link.txt
> 
> Am 07.01.2014 12:56, schrieb Cedric Doucet:
> > He llo,
> > 
> > I would like to know how to add "-lrt" at the end of link.txt.
> > I tried to do that by modifying CMakeLists.txt.
> > I added the following lines:
> > ----------------------------------------------------------------------------------------------------------------
> > list(APPEND CMAKE_CXX_FLAGS "-lrt")
> > list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)
> > string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
> > set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
> > ----------------------------------------------------------------------------------------------------------------
> > However, it does not work.
> > 
> > Anybody have an idea?
> 
> target_link_libraries(my_target_that_needs_rt rt)
> 
> HTH,
> 
> Eike
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For
> more information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 


More information about the CMake mailing list