CMakeList find_package OpenCV SVN
Hi all,
I have the following problem, which drives me crazy. I installed ROS fuerte with ros-fuerte-opencv2. I also compiled OpenCV from the svn repositories because I need CUDA and OpenGL support which is not included by ros opencv.
However, my rosnode always gets linked against the ROS opencv libraries. e.g.: libopencv_highgui.so.2.3 => /opt/ros/fuerte/lib/libopencv_highgui.so.2.3
my manifest.xml
<package>
<description brief="test">
test
</description>
<author>andreas</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/test</url>
<depend package="roscpp"/>
<depend package="cv_bridge"/>
<depend package="std_msgs"/>
<depend package="image_transport"/>
<rosdep name="opencv2.3.3"/>
</package>
before ros opencv got updated to versionn 2.3.3 it worked fine by the way. Now there's apparently no distinction between the version numbers any more.
My CMakeList.txt:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
set(ROS_BUILD_TYPE RelWithDebInfo)
find_package(OpenCV 2.3.3 REQUIRED)
find_package(GLUT)
find_package(OpenGL)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_library(CGaborKernel src/helper/CGaborKernel.cpp)
rosbuild_add_library(memory_stat src/helper/memory_stat.cpp)
find_package(CUDA)
if(CUDA_FOUND)
rosbuild_add_executable(img_node_cuda src/img_node_cuda.cpp)
target_link_libraries(img_node_cuda CGaborKernel memory_stat ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${OpenCV_LIBS})
endif()
I made it work for the moment by copying the svn libraries over the ros opencv libraries, but that's obiously the worst solution.