瀏覽代碼

Set CMake policy CMP0054 to shut-up associated warning

This commit will avoid the following warning:

CMake Warning (dev) at /path/to/cmake-3.1/Modules/ExternalProject.cmake:919 (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.

  Quoted variables like "PYTHONQT_INSTALL_DIR" will no longer be dereferenced
  when the policy is set to NEW.  Since the policy is not set the OLD
  behavior will be used.
Call Stack (most recent call first):
  /path/to/cmake-3.1/Modules/ExternalProject.cmake:1764 (_ep_write_initial_cache)
  /path/to/cmake-3.1/Modules/ExternalProject.cmake:1997 (_ep_add_configure_command)
  SuperBuild.cmake:37 (ExternalProject_Add)
  CMakeLists.txt:977 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.
Jean-Christophe Fillion-Robin 10 年之前
父節點
當前提交
47463f17bf
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      CMakeLists.txt

+ 8 - 0
CMakeLists.txt

@@ -20,6 +20,14 @@
 
 cmake_minimum_required(VERSION 2.8.9)
 
+foreach(p
+  CMP0054 # CMake 3.1
+  )
+  if(POLICY ${p})
+    cmake_policy(SET ${p} NEW)
+  endif()
+endforeach()
+
 #-----------------------------------------------------------------------------
 # Superbuild
 #