Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
构建Opencv中的Cmake策略设置_Opencv_Cmake - Fatal编程技术网

构建Opencv中的Cmake策略设置

构建Opencv中的Cmake策略设置,opencv,cmake,Opencv,Cmake,我不确定在哪里设置cmake_政策。 这解释了cmake_的政策。但不确定在哪里设置cmake策略。 我使用cmake构建Opencv,我有很多警告,比如 CMake Warning (dev) at cuda_compile_generated_row_filter.2.cu.o.cmake:137 (if): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when u

我不确定在哪里设置cmake_政策。 这解释了cmake_的政策。但不确定在哪里设置cmake策略。 我使用cmake构建Opencv,我有很多警告,比如

CMake Warning (dev) at cuda_compile_generated_row_filter.2.cu.o.cmake:137 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
我需要设置like
cmake\U策略(设置CMP0054新)
。 在哪里设置此策略? 我确实喜欢

ppp@ppp-Inspiron-7537:~/Softwares/opencv-2.4.9/build$ cmake_policy(SET CMP0054 NEW)
bash: syntax error near unexpected token `SET'
但我犯了个错误。
如何设置策略?

使用
-Wno dev
选项
cmake
抑制针对开发人员的警告:

cmake -Wno-dev <other-options> <source-dir>
在开始的某个地方

请注意,您需要为属性使用OLD值,因为项目很可能依赖于此类变量的解引用。设置新值可能会破坏项目的功能

当项目的代码被修复时,即使没有明确的策略集,也不会生成警告

cmake_policy(SET CMP0054 OLD)