我正在尝试用 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})
谢谢!!