c++ - Error with the CMakeLists.txt in opencv project -
c++ - Error with the CMakeLists.txt in opencv project -
i'm begining opencv project in c++ , figure it'll nice occasion larn cmake. project hirerachy:
project/ |__include/ |__sample1.h |__sample2.h |__build/ |__doc/ |__src/ |__sample1.cpp |__sample2.cpp |__test/ |__main.cpp |__cmakelists.txt
the cmakelists.txt :
cmake_minimum_required( version 2.8 ) set( proj_name "project" ) set( proj_path ${cmake_source_dir} ) set( proj_out_path ${cmake_binary_dir} ) set( proj_libraries ${opencv_libs} ) set( proj_includes "include" ) file( glob_recurse proj_sources src/*cpp test/*cpp ) file( glob_recurse proj_headers include/${proj_name}/*.h ) project( ${proj_name} ) find_package( opencv required ) include_directories( ${proj_includes} ) add_executable( ${proj_name} ${proj_sources} ) target_link_libraries( ${proj_name} ${proj_libraries} )
the makefile generated, when execute "make" have "undefined references" opencv functions.
any help appreciated, , of course of study if want more info inquire :)
thanks
set( proj_libraries ${opencv_libs} )
opencv_libs set after search bundle find_package().
you need add together headers add_executable().
c++ opencv cmake
Comments
Post a Comment