[Insight-developers] cmake warning when compiling against installed ITK (release branch)

Brad King brad.king at kitware.com
Thu Oct 27 09:14:03 EDT 2011


On 10/27/2011 8:34 AM, Arnaud Gelas wrote:
> On Oct 27, 2011, at 7:59 AM, Casey Goodlett wrote:
>
>> I recompiled today against an installed version of ITK v3.20.1, and I
>> have the same error message from CMake CMP0012 at the same block of
>> code. Is there a better way to setup that conditional to have a valid
>> boolean inside the if statement?

No, and that's the behavior that CMP0012 fixed:

  http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012

You can quiet the warning by adding

  cmake_policy(SET CMP0012 NEW)

in your project's CMake code or by changing your minimum required
version of CMake to 2.8.0:

  cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)

 > I guess the problem comes from
 >
 > IF("@ITK_USE_REVIEW@")
 >
 > which should be changed by
 >
 > IF( "@ITK_USE_REVIEW@" MATCHES "ON" )

This would workaround the warning but should not be necessary.
Another workaround is to make sure ITK_USE_REVIEW is set to 0
or 1 instead of FALSE or TRUE when building ITK.

-Brad


More information about the Insight-developers mailing list