ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is the code for CMake.txt:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_executable(WhichFace src/WhichFace.py)

Python nodes are not 'executables' in the sense that you can rosmake them. You cannot rosbuild_add_executable(..) as that will cause CMake (underlying rosbuild) to try and setup all sorts of make targets for building and linking the Python script as if it were a C/C++ program. That is obviously not the case, so it fails.

See wiki/rospy_tutorials/Tutorials/Makefile (make sure to switch to rosbuild at the top of the page) for how to setup a CMakeLists.txt for Python nodes under rosbuild.