CMake无法找到类似cv.h的OpenCV库

uqdfh47h  于 2022-11-11  发布在  其他
关注(0)|答案(1)|浏览(183)

我本来想在Ubuntu PC上运行这个项目,但是我收到了一个错误。
当我运行下面的代码时;

make

并且,在下面有一个错误;

asiye@asiye:~/Desktop/cmfd_framework/build$ make
Consolidate compiler generated dependencies of target common
[  8%] Built target common
[ 10%] Building CXX object ground_truth_db/CMakeFiles/cmfdgt.dir/command_ground_truth.cpp.o
/home/asiye/Desktop/cmfd_framework/ground_truth_db/command_ground_truth.cpp:10:10: fatal error: cv.h: No such file or directory
   10 | #include "cv.h"
      |          ^~~~
compilation terminated.
make[2]: * [ground_truth_db/CMakeFiles/cmfdgt.dir/build.make:76: ground_truth_db/CMakeFiles/cmfdgt.dir/command_ground_truth.cpp.o] Error 1
make[1]: * [CMakeFiles/Makefile2:205: ground_truth_db/CMakeFiles/cmfdgt.dir/all] Error 2
make: * [Makefile:91: all] Error 2

我认为Cmake找不到OpenCV库,但为什么呢?
你能向我解释一下是否有其他方法来解决这个问题吗?
顺祝商祺!

jdzmm42g

jdzmm42g1#

Cmake多夏瑟布拉达Yunus Temurlenk

CMakeLists.txt文件

cmake_minimum_required(VERSION 2.6)
project(Vole)

set(Vole_CMFD ON)
set(Vole_CMFD_Ground_Truth ON)
set(Vole_Shell ON)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

include(VoleHelperMacros)
include(VoleModuleMacros)

if(WIN32)
    add_definitions(-DNOMINMAX) # prevents min- and max-macro brainf*ck in VS 2003
endif(WIN32)

# Global options

option(VOLE_CMAKE_DEBUG_OUTPUT "Show additonal cmake debug output." OFF)
mark_as_advanced(VOLE_CMAKE_DEBUG_OUTPUT)
option(VOLE_CHECK_DEPENDENCIES "Do additional dependency check with nice error messages." ON)
mark_as_advanced(VOLE_CHECK_DEPENDENCIES)
option(VOLE_SINGLE_TARGETS "Build single targets for each command." OFF)
set(VOLE_MODULE_DIRECTORIES "" CACHE STRING "Semicolon-separated list of module directories for vole, e.g. the forensics or the color code.")

# maybe there is a better place for these two options:

option(Boost_NO_SYSTEM_PATHS "Suppress searching in system paths or other locations outside of BOOST_ROOT." OFF)
set(BOOST_ROOT "" CACHE STRING "The preferred installation prefix for searching for Boost. Set this if the module has problems finding the proper Boost installation.")

# Global variables

set(VOLE_PACKAGE_LIST "" CACHE INTERNAL "Package list" FORCE)
set(VOLE_EXTERNAL_SUBDIRECTORIES "" CACHE INTERNAL "External subdirectories" FORCE)
set(VOLE_MODULE_LIST "" CACHE INTERNAL "Module list" FORCE)

include(VoleFindPackages)

# include(VoleFindExternalModules)

add_subdirectory(common core/common)

include_directories(common shell cmfd ground_truth_db)
add_subdirectory(cmfd cmfd)
add_subdirectory(ground_truth_db ground_truth_db)
add_subdirectory(shell core/shell)

include(VoleCheckDependencies)

INCLUDE("CMakeModules/TargetDoc.cmake" OPTIONAL)

相关问题