我希望在Ubuntu上运行Surfgpu,但不知道如何编写Cmakelists。我已经安装了CUDA 4.2 SDK和Toolkit,并且程序中的C语言可以运行。我的开发环境是Qt。Ubuntu 11.10.Opencv2.4.2。
如果您有好的建议,请告诉我。谢谢!
# CMakeLists.txt to build OpenCV project
cmake_minimum_required(VERSION 2.8)
project( testOpenCV )
查找OpenCV和CUDA软件包
find_package(OpenCV REQUIRED )
find_package(CUDA 4.2 REQUIRED)
从一些目录中包含
# Since surf is a non free package, you also have to add non free include dir
include_directories( ${OpenCV_INCLUDE_DIR} "${OpenCV_SOURCE_DIR}/modules/nonfree/include" ${CUDA_INCLUDE_DIRS})
cuda_add_executable( exefile source.cpp source2.cpp )
target_link_libraries( exefile ${OpenCV_LIBS} ${otherlibsyouneed} )
-DHAVE_CUDA
编译OpenCV时才有效。