In CMake 3.1.3 and later invoking check_type_size from the module
CheckTypeSize.cmake causes a policy CMP0054 warning.

For example, when building zlib-1.28 (on Windows):

CMake Warning (dev) at
C:/ProgramData/chocolatey/lib/cmake/content/cmake-3.1.3-win32-x86/share/cmake-3.1/Modules/CheckTypeSize.cmake:232
(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 "C" 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):
  E:/Wireshark/wireshark-win32-libs/zlib-1.2.8/CMakeLists.txt:43
(check_type_size)

As the function has a cmake_policy_push(), followed by a
cmake_policy(VERSION 3.0) at the start we can't pass down a policy setting.

I can fix this locally by changing the policy set to 3.1

There might be other similarly afflicted modules.

I looked but couldn't see anything on the bug tracker, shall I raise an
issue?

-- 
Graham Bloice
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to