[vtk-developers] VTK and CMake 2.8rc2 - argument named "TRUE" in a conditional - policy CMP0012

Brad King brad.king at kitware.com
Fri Oct 2 14:23:55 EDT 2009


Sean McBride wrote:
> Hi all,
> 
> I just tried building VTK CVS with CMake 2.8rc2 and get this message:
> 
> CMake Warning (dev) at CMake/vtkDetermineCompilerFlags.cmake:98 (IF):
>   given arguments
> 
>     ${CXX_HAS_CPP_PRECOMP_FLAG} 
> 
>   You have used a variable or argument named "TRUE" in a conditional
>   statement.  Please be aware of issues related to policy CMP0012.  Policy
>   CMP0012 is not set: The if() command can recognize named boolean constants.
>   Run "cmake --help-policy CMP0012" for policy details.  Use the cmake_policy
>   command to set the policy and suppress this warning.
> Call Stack (most recent call first):
>   CMakeLists.txt:396 (INCLUDE)
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> Any CMake experts out there know how to fix it?

Follow the instructions in the message and read the output of
"cmake --help-policy CMP0012".  It explains that strings like
"TRUE" were not previously considered boolean constants.

In your case, the variable evaluation produces the command

  if(TRUE)

and it is evaluating to false.  The message is warning that
CMake is preserving the older wrong behavior because the
policy has not been set to OLD or NEW.

The above message also explains that cmake_policy() can be used
to set the policy.  See also the if(POLICY) mode documentation.

  http://www.cmake.org/Wiki/CMake_Policies#Updating_a_Project_for_a_new_CMake_Version
  http://www.cmake.org/cmake/help/cmake2.6docs.html#command:cmake_policy
  http://www.cmake.org/cmake/help/cmake2.6docs.html#command:if

-Brad




More information about the vtk-developers mailing list