我对柳絮有问题。当我在catkin工作区中运行catkin_make时,它说:
CMake错误:未设置内部CMake变量所需的错误,cmake可能 不能正确构建。缺少的变量是:
CMAKE_python_LINK_EXECUTABLE
我的cmakelist.txt如下:
cmake_minimum_required(VERSION 2.8.3)
project(opencv_face_recognition)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
image_transport
rospy
sensor_msgs
std_msgs
)
find_package(PythonLibs REQUIRED)
find_package(OpenCV REQUIRED)
catkin_python_setup()
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES opencv_face_recognition
# CATKIN_DEPENDS cv_bridge image_transport rospy sensor_msgs std_msgs
# DEPENDS system_lib
)
include_directories(
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
add_executable(
${PROJECT_NAME}_node src/webcam_cv3.py
)
target_link_libraries(${PROJECT_NAME}_node
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
)
catkin_install_python(PROGRAMS
src/webcam_cv3.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
SET_TARGET_PROPERTIES(opencv_face_recognition_node PROPERTIES LINKER_LANGUAGE python)
我的setup.py文件如下:
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['opencv_face_recognition'],
package_dir={'': 'src'})
setup(**setup_args)
在此先感谢您的帮助