Asiye
Asiye

Reputation: 21

CMake could not find OpenCV library like cv.h

I'd wanted to run the project in Ubuntu PC, but I received an error.

When I ran the following code;

make

And, There is a error in following;

      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

I think Cmake could not find OpenCV library but why ?

Could you explain to me if there is another way to address this problem?

Best Regards,

Upvotes: 1

Views: 90

Answers (1)

Asiye
Asiye

Reputation: 21

Cmake Dosyası burada 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)

Upvotes: 1

Related Questions