Cmake and library linker flags for bluetooth
bluetooth, cmake
Solution
try:
set(EXTRA_LIBS ${YARP_LIBRARIES})
list(APPEND EXTRA_LIBS "m")
list(APPEND EXTRA_LIBS "bluetooth")
target_link_libraries(send_angles ${EXTRA_LIBS})
or:
target_link_libraries(send_angles "${YARP_LIBRARIES};m;bluetooth")
Problem
I am trying to compile a .cpp program with CMAKE. When I was simply using gcc on terminal I needed to type: ``` gcc nxt_bt_connect.c -o nxt_bt_connect -lm -lbluetooth ``` How do I include these two linker flags to my CmakeLists.txt (pasted below) file? ``` # YARP needs CMake 2.6 or greater cmake_minimum_required(VERSION 2.6) # find YARP find_package(YARP REQUIRED) # add YARP include directories include_directories(${YARP_INCLUDE_DIRS}) # set up our program add_executable(send_angles send_angles.cpp) # link with YARP libraries target_link_libraries(send_angles ${YARP_LIBRARIES}) ``` Thank you!!