project(test) cmake_minimum_required(VERSION 3.0) find_package(OpenCV REQUIRED) find_package (Python3 COMPONENTS Interpreter Development REQUIRED) include_directories( ${Python3_INCLUDE_DIRS}) link_directories(${Python3_LIBRARY_DIRS}) add_executable( test test.cpp ) target_link_libraries( test ${OpenCV_LIBS} ${Python3_LIBRARIES} )