无法在CMake

时间:2017-07-12 06:09:22

标签: opencv cmake

我正在关注this教程,使用CMake统一安装OpenCV。我坚持第6步。我已经在CMake中为源代码字段指定了源文件夹,并为目标创建了一个新文件夹。我测试了所有三个生成器选项,即Visual Studio 15 2017,Visual Studio 15 2017 win x64,Visual Studio 15 2017 ARM,

问题是我无法配置它。它说:enter image description here 以下是CMakeOutput.log文件内容: -

  

系统是:Windows - 6.1.7601 - AMD64

以下是CMakeCache.txt文件内容: -

> # This is the CMakeCache file.
> # For build in directory: c:/Users/bhism/Downloads/Install
> # It was generated by CMake: D:/software/CMake/cmake-3.9.0-rc5-win64-x64/bin/cmake.exe
> # You can edit this file to change values found and used by cmake.
> # If you do not want to change any of the values, simply exit the editor.
> # If you do want to change a value, simply edit, save, and exit the editor.
> # The syntax for the file is as follows:
> # KEY:TYPE=VALUE
> # KEY is the name of a variable in the cache.
> # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
> # VALUE is the current value for the KEY.
> 
> ########################
> # EXTERNAL cache entries
> ########################
> 
> //Configs CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release
> 
> //Installation Directory
> CMAKE_INSTALL_PREFIX:PATH=C:/Users/bhism/Downloads/Install/install
> 
> //Value Computed by CMake CMAKE_PROJECT_NAME:STATIC=OpenCV
> 
> //Value Computed by CMake
> OpenCV_BINARY_DIR:STATIC=C:/Users/bhism/Downloads/Install
> 
> //Value Computed by CMake
> OpenCV_SOURCE_DIR:STATIC=C:/Users/bhism/Downloads/opencv/sources
> 
> 
> ########################
> # INTERNAL cache entries
> ########################
> 
> //This is the directory where this CMakeCache.txt was created
> CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/bhism/Downloads/Install //Major
> version of cmake used to create the current loaded cache
> CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 //Minor version of cmake used to
> create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=9
> //Patch version of cmake used to create the current loaded cache
> CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 //Path to CMake executable.
> CMAKE_COMMAND:INTERNAL=D:/software/CMake/cmake-3.9.0-rc5-win64-x64/bin/cmake.exe
> //Path to cpack program executable.
> CMAKE_CPACK_COMMAND:INTERNAL=D:/software/CMake/cmake-3.9.0-rc5-win64-x64/bin/cpack.exe
> //Path to ctest program executable.
> CMAKE_CTEST_COMMAND:INTERNAL=D:/software/CMake/cmake-3.9.0-rc5-win64-x64/bin/ctest.exe
> //Name of external makefile project generator.
> CMAKE_EXTRA_GENERATOR:INTERNAL= //Name of generator.
> CMAKE_GENERATOR:INTERNAL=Visual Studio 15 2017 ARM //Name of generator
> platform. CMAKE_GENERATOR_PLATFORM:INTERNAL= //Name of generator
> toolset. CMAKE_GENERATOR_TOOLSET:INTERNAL= //Source directory with the
> top level CMakeLists.txt file for this // project
> CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/bhism/Downloads/opencv/sources
> //number of local generators CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
> //Platform information initialized
> CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 //Path to CMake
> installation.
> CMAKE_ROOT:INTERNAL=D:/software/CMake/cmake-3.9.0-rc5-win64-x64/share/cmake-3.9

实际的错误讯息: -

    CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
  The OLD behavior for policy CMP0020 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:76 (cmake_policy):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:81 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error at CMakeLists.txt:98 (project):
  Failed to run MSBuild command:

    MSBuild.exe

  to get the value of VCTargetsPath:





Configuring incomplete, errors occurred!
See also "C:/Users/bhism/Downloads/Install/CMakeFiles/CMakeOutput.log".

1 个答案:

答案 0 :(得分:1)

我已经厌倦了昨天寻找这个错误的解决方案。所以,决定重新开始这一天。卸载所有组件。再次下载所有组件。再试一次。在第三或第四次调整中,我的工作就像没有任何问题。这个问题现在解决了,谢谢