CMakeLists.txt 1.55 KB
Newer Older
Ken Tossell's avatar
Ken Tossell committed
1
2
3
4
# 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
5
6
7
find_package(catkin REQUIRED COMPONENTS roscpp camera_info_manager driver_base dynamic_reconfigure image_transport nodelet sensor_msgs)

generate_dynamic_reconfigure_options(cfg/UVCCamera.cfg)
Ken Tossell's avatar
Ken Tossell committed
8

9
10
find_package(libuvc REQUIRED)

11
12
13
14
15
16
17
18
19
20
21
catkin_package(
  CATKIN_DEPENDS
    roscpp
    camera_info_manager
    driver_base
    dynamic_reconfigure
    image_transport
    nodelet
    sensor_msgs
  LIBRARIES libuvc_camera_nodelet
  )
Ken Tossell's avatar
Ken Tossell committed
22

23
include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${libuvc_INCLUDE_DIRS})
Ken Tossell's avatar
Ken Tossell committed
24
link_directories(${catkin_LINK_DIRS})
Ken Tossell's avatar
Ken Tossell committed
25

Ken Tossell's avatar
Ken Tossell committed
26
27
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
Ken Tossell's avatar
Ken Tossell committed
28

Ken Tossell's avatar
Ken Tossell committed
29
add_executable(camera_node src/main.cpp src/camera_driver.cpp)
30
target_link_libraries(camera_node ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${libuvc_LIBRARIES})
31
add_dependencies(camera_node ${PROJECT_NAME}_gencfg)
Ken Tossell's avatar
Ken Tossell committed
32

Ken Tossell's avatar
Ken Tossell committed
33
add_library(libuvc_camera_nodelet src/nodelet.cpp src/camera_driver.cpp)
34
add_dependencies(libuvc_camera_nodelet ${libuvc_camera_EXPORTED_TARGETS})
35
target_link_libraries(libuvc_camera_nodelet ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${libuvc_LIBRARIES})
36
add_dependencies(libuvc_camera_nodelet ${PROJECT_NAME}_gencfg)
37
38
39
40

install(TARGETS camera_node libuvc_camera_nodelet
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
41
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
42
  )