我正在尝试使用CMAKE编译一个.cpp程序。 当我只是在终端上使用gcc时,我需要输入:
gcc nxt_bt_connect.c -o nxt_bt_connect -lm -lbluetooth
我该如何将这两个链接器标志包含到我的CmakeLists.txt文件中(如下所示)?
# 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})
谢谢!