CMake 版本不匹配

CMake 版本不匹配

我试图获取 OpenCV 的 Java LBPH 分类器,为此我需要使用 cmake。在这种情况下,他们说 cmake 的最低版本是:“3.29”,而我有 3.22。

我按照这里的建议进行了升级:我如何升级

我正在尝试将此命令与 cmake 一起使用:“cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=/home/alex/opencv_contrib”,如下所示:构建

但我仍然有这个错误:

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:2 (ocv_define_module):
  Unknown CMake command "ocv_define_module".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.29)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

我使用了“cmake --version”命令,结果如下:

cmake version 3.29.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

相关内容