Skip to content
Snippets Groups Projects
Commit c2918f65 authored by Ken Tossell's avatar Ken Tossell
Browse files

catkin build

parent ab0095f4
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Append to CPACK_SOURCE_IGNORE_FILES a semicolon-separated list of
# directories (or patterns, but directories should suffice) that should
# be excluded from the distro. This is not the place to put things that
# should be ignored everywhere, like "build" directories; that happens in
# rosbuild/rosbuild.cmake. Here should be listed packages that aren't
# ready for inclusion in a distro.
#
# This list is combined with the list in rosbuild/rosbuild.cmake. Note
# that CMake 2.6 may be required to ensure that the two lists are combined
# properly. CMake 2.4 seems to have unpredictable scoping rules for such
# variables.
#list(APPEND CPACK_SOURCE_IGNORE_FILES /core/experimental)
rosbuild_make_distribution(0.1.0)
#include $(shell rospack find mk)/cmake.mk
.PHONY: clean download
BUILD_TYPE?=Release
CMAKE=cmake
CMAKE_ARGS=-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=`rospack find libuvc`/libuvc
all:
mkdir -p build
@git clone git://github.com/ktossell/libuvc.git build/git || (echo "INFO: skipping clone"; true)
cd build/git && git pull
mkdir -p build/build
cd build/build && $(CMAKE) ../git $(CMAKE_ARGS)
cd build/build && make && make install
# you shouldn't have to do this, but it works for the Mac
if [ `uname` = Darwin ]; then \
install_name_tool -id `rospack find libuvc`/libuvc/lib/libuvc.dylib `rospack find libuvc`/libuvc/lib/libuvc.dylib; \
fi
clean:
rm -rf build/build libuvc
<package>
<description brief="low-level driver for USB video cameras">
This package pulls in the libuvc library for USB Video Class devices.
</description>
<author>Ken Tossell</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/libuvc</url>
<export>
<cpp cflags="-I${prefix}/libuvc/include" lflags="-L${prefix}/libuvc/lib -Wl,-rpath,-L${prefix}/libuvc/lib"/>
<cpp os="osx" cflags="-I${prefix}/libuvc/include" lflags="-L${prefix}/libuvc/lib -Wl,-rpath,-L${prefix}/libuvc/lib -framework CoreServices"/>
</export>
<rosdep name="libusb-1.0"/>
</package>
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
cmake_minimum_required(VERSION 2.8.3)
project(libuvc_camera)
# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS libuvc)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
#find_package(libuvc REQUIRED)
catkin_package(DEPENDS roscpp camera_info_manager driver_base dynamic_reconfigure image_transport nodelet sensor_msgs libuvc
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME})
rosbuild_init()
include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})
link_directories(${catkin_LINK_DIRS})
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
find_package(catkin REQUIRED dynamic_reconfigure)
generate_dynamic_reconfigure_options(cfg/UVCCamera.cfg)
#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
rosbuild_find_ros_package(dynamic_reconfigure)
include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
gencfg()
#find_package(libuvc REQUIRED)
include_directories(${libuvc_INCLUDE_DIRS})
#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
add_executable(camera_node src/main.cpp src/camera_driver.cpp)
target_link_libraries(camera_node uvc ${Boost_LIBRARIES})
rosbuild_add_executable(camera_node src/main.cpp src/camera_driver.cpp)
target_link_libraries(camera_node uvc)
rosbuild_add_library(libuvc_camera_nodelet src/nodelet.cpp src/camera_driver.cpp)
target_link_libraries(libuvc_camera_nodelet uvc)
add_library(libuvc_camera_nodelet src/nodelet.cpp src/camera_driver.cpp)
target_link_libraries(libuvc_camera_nodelet uvc ${Boost_LIBRARIES})
#! /usr/bin/env python
#! /usr/bin/env python2
# Derived from camera1394 cfg
PACKAGE='libuvc_camera'
......
<package>
<description brief="driver for USB video cameras">
This is a ROS driver for USB video cameras (webcams)
and other media input devices that support the USB Video Class
specification.
</description>
<author>Ken Tossell</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/libuvc_camera</url>
<depend package="roscpp"/>
<depend package="camera_info_manager"/>
<depend package="driver_base"/>
<depend package="dynamic_reconfigure"/>
<depend package="image_transport"/>
<depend package="nodelet"/>
<depend package="sensor_msgs"/>
<depend package="libuvc"/>
<export>
<nodelet plugin="${prefix}/libuvc_camera_nodelet.xml"/>
</export>
</package>
<stack>
<description brief="driver for USB cameras">
This stack contains a driver for USB video cameras
that implement the USB Video Class specification.
</description>
<author>Maintained by Ken Tossell</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/libuvc_ros</url>
<depend stack="common_msgs" /> <!-- sensor_msgs -->
<depend stack="driver_common" /> <!-- dynamic_reconfigure, driver_base -->
<depend stack="image_common" /> <!-- camera_info_manager, image_transport -->
<depend stack="ros" />
<depend stack="ros_comm" /> <!-- roscpp -->
</stack>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment