Skip to content

Commit 8aab174

Browse files
author
Libor Wagner
committed
Fix the package so it compiles under hydro
1 parent 0bda931 commit 8aab174

File tree

6 files changed

+271
-74
lines changed

6 files changed

+271
-74
lines changed

Diff for: CMakeLists.txt

+24-47
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,24 @@
1-
cmake_minimum_required(VERSION 2.4.6)
2-
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
3-
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules )
4-
FIND_PACKAGE(Aravis)
5-
6-
include(FindPkgConfig)
7-
pkg_check_modules(GLIB glib-2.0)
8-
9-
# Set the build type. Options are:
10-
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
11-
# Debug : w/ debug symbols, w/o optimization
12-
# Release : w/o debug symbols, w/ optimization
13-
# RelWithDebInfo : w/ debug symbols, w/ optimization
14-
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
15-
#set(ROS_BUILD_TYPE RelWithDebInfo)
16-
set(ROS_BUILD_TYPE Debug)
17-
18-
rosbuild_init()
19-
20-
#set the default path for built executables to the "bin" directory
21-
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
22-
#set the default path for built libraries to the "lib" directory
23-
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
24-
25-
# add dynamic reconfigure api
26-
rosbuild_find_ros_package(dynamic_reconfigure)
27-
include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
28-
gencfg()
29-
30-
#uncomment if you have defined messages
31-
#rosbuild_genmsg()
32-
#uncomment if you have defined services
33-
#rosbuild_gensrv()
34-
35-
#common commands for building c++ executables and libraries
36-
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
37-
#target_link_libraries(${PROJECT_NAME} another_library)
38-
#rosbuild_add_boost_directories()
39-
#rosbuild_link_boost(${PROJECT_NAME} thread)
40-
#rosbuild_add_executable(example examples/example.cpp)
41-
#target_link_libraries(example ${PROJECT_NAME})
42-
43-
rosbuild_add_executable(camnode src/camnode.cpp)
44-
target_link_libraries(camnode ${ARAVIS_LIBRARY} ${GLIB_LIBRARIES})
45-
#target_link_libraries(camnode libaravis-0.4.a glib-2.0 gobject-2.0 gio-2.0 xml2 gthread-2.0)
46-
include_directories(${ARAVIS_INCLUDE_PATH} ${GLIB_INCLUDE_DIRS})
47-
1+
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
2+
cmake_minimum_required(VERSION 2.8.3)
3+
project(camera_aravis)
4+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
5+
find_package(catkin REQUIRED COMPONENTS roscpp sensor_msgs image_transport camera_info_manager dynamic_reconfigure driver_base tf dynamic_reconfigure)
6+
find_package(Aravis REQUIRED)
7+
find_package(GLIB2 REQUIRED)
8+
9+
generate_dynamic_reconfigure_options(cfg/CameraAravisConfig.cfg)
10+
catkin_package(
11+
DEPENDS Aravis GLIB2
12+
CATKIN_DEPENDS roscpp sensor_msgs image_transport camera_info_manager dynamic_reconfigure driver_base tf
13+
INCLUDE_DIRS
14+
LIBRARIES
15+
)
16+
17+
include_directories(cfg/cpp ${catkin_INCLUDE_DIRS} ${ARAVIS_INCLUDE_PATH} ${GLIB2_INCLUDE_DIRS})
18+
19+
message(${ARAVIS_LIBRARY})
20+
21+
add_executable(camnode src/camnode.cpp)
22+
23+
target_link_libraries(camnode ${catkin_LIBRARIES} ${ARAVIS_LIBRARY} glib-2.0 gmodule-2.0 gobject-2.0)
24+
add_dependencies(camnode ${PROJECT_NAME}_gencfg)

Diff for: CMakeModules/FindAravis.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ INCLUDE(FindPackageHandleStandardArgs)
22

33
FIND_PATH(ARAVIS_INCLUDE_PATH arv.h
44
"$ENV{ARAVIS_INCLUDE_PATH}"
5-
/usr/local/include/aravis-0.4
5+
/usr/local/include/aravis-0.2
66
)
77

8-
FIND_LIBRARY(ARAVIS_LIBRARY aravis-0.4
8+
FIND_LIBRARY(ARAVIS_LIBRARY aravis-0.2
99
"$ENV{ARAVIS_LIBRARY}"
1010
/usr/local/lib
1111
)

Diff for: CMakeModules/FindGLIB2.cmake

+217
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# - Try to find GLib2
2+
# Once done this will define
3+
#
4+
# GLIB2_FOUND - system has GLib2
5+
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
6+
# GLIB2_LIBRARIES - Link these to use GLib2
7+
#
8+
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
9+
# supports g_regex_match_simple
10+
#
11+
# Copyright (c) 2006 Andreas Schneider <[email protected]>
12+
# Copyright (c) 2006 Philippe Bernery <[email protected]>
13+
# Copyright (c) 2007 Daniel Gollub <[email protected]>
14+
# Copyright (c) 2007 Alban Browaeys <[email protected]>
15+
# Copyright (c) 2008 Michael Bell <[email protected]>
16+
# Copyright (c) 2008 Bjoern Ricks <[email protected]>
17+
#
18+
# Redistribution and use is allowed according to the terms of the New
19+
# BSD license.
20+
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
21+
#
22+
23+
24+
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
25+
# in cache already
26+
SET(GLIB2_FOUND TRUE)
27+
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
28+
29+
INCLUDE(FindPkgConfig)
30+
31+
## Glib
32+
IF ( GLIB2_FIND_REQUIRED )
33+
SET( _pkgconfig_REQUIRED "REQUIRED" )
34+
ELSE ( GLIB2_FIND_REQUIRED )
35+
SET( _pkgconfig_REQUIRED "" )
36+
ENDIF ( GLIB2_FIND_REQUIRED )
37+
38+
IF ( GLIB2_MIN_VERSION )
39+
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
40+
ELSE ( GLIB2_MIN_VERSION )
41+
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
42+
ENDIF ( GLIB2_MIN_VERSION )
43+
IF ( PKG_CONFIG_FOUND )
44+
IF ( GLIB2_FOUND )
45+
SET ( GLIB2_CORE_FOUND TRUE )
46+
ELSE ( GLIB2_FOUND )
47+
SET ( GLIB2_CORE_FOUND FALSE )
48+
ENDIF ( GLIB2_FOUND )
49+
ENDIF ( PKG_CONFIG_FOUND )
50+
51+
# Look for glib2 include dir and libraries w/o pkgconfig
52+
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
53+
FIND_PATH(
54+
_glibconfig_include_DIR
55+
NAMES
56+
glibconfig.h
57+
PATHS
58+
/opt/gnome/lib64
59+
/opt/gnome/lib
60+
/opt/lib/
61+
/opt/local/lib
62+
/sw/lib/
63+
/usr/lib64
64+
/usr/lib
65+
/usr/local/include
66+
${CMAKE_LIBRARY_PATH}
67+
PATH_SUFFIXES
68+
glib-2.0/include
69+
)
70+
71+
FIND_PATH(
72+
_glib2_include_DIR
73+
NAMES
74+
glib.h
75+
PATHS
76+
/opt/gnome/include
77+
/opt/local/include
78+
/sw/include
79+
/usr/include
80+
/usr/local/include
81+
PATH_SUFFIXES
82+
glib-2.0
83+
)
84+
85+
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
86+
87+
FIND_LIBRARY(
88+
_glib2_link_DIR
89+
NAMES
90+
glib-2.0
91+
glib
92+
PATHS
93+
/opt/gnome/lib
94+
/opt/local/lib
95+
/sw/lib
96+
/usr/lib
97+
/usr/local/lib
98+
)
99+
IF ( _glib2_include_DIR AND _glib2_link_DIR )
100+
SET ( _glib2_FOUND TRUE )
101+
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
102+
103+
104+
IF ( _glib2_FOUND )
105+
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
106+
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
107+
SET ( GLIB2_CORE_FOUND TRUE )
108+
ELSE ( _glib2_FOUND )
109+
SET ( GLIB2_CORE_FOUND FALSE )
110+
ENDIF ( _glib2_FOUND )
111+
112+
# Handle dependencies
113+
# libintl
114+
IF ( NOT LIBINTL_FOUND )
115+
FIND_PATH(LIBINTL_INCLUDE_DIR
116+
NAMES
117+
libintl.h
118+
PATHS
119+
/opt/gnome/include
120+
/opt/local/include
121+
/sw/include
122+
/usr/include
123+
/usr/local/include
124+
)
125+
126+
FIND_LIBRARY(LIBINTL_LIBRARY
127+
NAMES
128+
intl
129+
PATHS
130+
/opt/gnome/lib
131+
/opt/local/lib
132+
/sw/lib
133+
/usr/local/lib
134+
/usr/lib
135+
)
136+
137+
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
138+
SET (LIBINTL_FOUND TRUE)
139+
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
140+
ENDIF ( NOT LIBINTL_FOUND )
141+
142+
# libiconv
143+
IF ( NOT LIBICONV_FOUND )
144+
FIND_PATH(LIBICONV_INCLUDE_DIR
145+
NAMES
146+
iconv.h
147+
PATHS
148+
/opt/gnome/include
149+
/opt/local/include
150+
/opt/local/include
151+
/sw/include
152+
/sw/include
153+
/usr/local/include
154+
/usr/include
155+
PATH_SUFFIXES
156+
glib-2.0
157+
)
158+
159+
FIND_LIBRARY(LIBICONV_LIBRARY
160+
NAMES
161+
iconv
162+
PATHS
163+
/opt/gnome/lib
164+
/opt/local/lib
165+
/sw/lib
166+
/usr/lib
167+
/usr/local/lib
168+
)
169+
170+
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
171+
SET (LIBICONV_FOUND TRUE)
172+
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
173+
ENDIF ( NOT LIBICONV_FOUND )
174+
175+
IF (LIBINTL_FOUND)
176+
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
177+
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
178+
ENDIF (LIBINTL_FOUND)
179+
180+
IF (LIBICONV_FOUND)
181+
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
182+
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
183+
ENDIF (LIBICONV_FOUND)
184+
185+
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
186+
##
187+
188+
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
189+
SET (GLIB2_FOUND TRUE)
190+
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
191+
192+
IF (GLIB2_FOUND)
193+
IF (NOT GLIB2_FIND_QUIETLY)
194+
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
195+
ENDIF (NOT GLIB2_FIND_QUIETLY)
196+
ELSE (GLIB2_FOUND)
197+
IF (GLIB2_FIND_REQUIRED)
198+
MESSAGE (SEND_ERROR "Could not find GLib2")
199+
ENDIF (GLIB2_FIND_REQUIRED)
200+
ENDIF (GLIB2_FOUND)
201+
202+
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
203+
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
204+
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
205+
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
206+
207+
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
208+
209+
IF ( GLIB2_FOUND )
210+
# Check if system has a newer version of glib
211+
# which supports g_regex_match_simple
212+
INCLUDE( CheckIncludeFiles )
213+
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
214+
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
215+
# Reset CMAKE_REQUIRED_INCLUDES
216+
SET( CMAKE_REQUIRED_INCLUDES "" )
217+
ENDIF( GLIB2_FOUND )

Diff for: Makefile

-1
This file was deleted.

Diff for: manifest.xml

-24
This file was deleted.

Diff for: package.xml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<package>
2+
<name>camera_aravis</name>
3+
<version>0.0.1</version>
4+
<description>camera_aravis</description>
5+
<maintainer email="[email protected]">Steve Safarik</maintainer>
6+
7+
<license>LGPL</license>
8+
9+
<author>strawlab</author>
10+
<author>Steve Safarik</author>
11+
12+
<buildtool_depend>catkin</buildtool_depend>
13+
<build_depend>roscpp</build_depend>
14+
<build_depend>sensor_msgs</build_depend>
15+
<build_depend>image_transport</build_depend>
16+
<build_depend>camera_info_manager</build_depend>
17+
<build_depend>dynamic_reconfigure</build_depend>
18+
<build_depend>driver_base</build_depend>
19+
<build_depend>tf</build_depend>
20+
<run_depend>roscpp</run_depend>
21+
<run_depend>sensor_msgs</run_depend>
22+
<run_depend>image_transport</run_depend>
23+
<run_depend>camera_info_manager</run_depend>
24+
<run_depend>dynamic_reconfigure</run_depend>
25+
<run_depend>driver_base</run_depend>
26+
<run_depend>tf</run_depend>
27+
28+
</package>

0 commit comments

Comments
 (0)