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

Sean McBride sean at rogue-research.com
Fri Oct 2 17:01:40 EDT 2009


On 10/2/09 3:10 PM, Brad King said:

>I've published a patch here:
>
>  http://github.com/bradking/ParaView/tree/cmake-2.8
>  http://github.com/bradking/ParaView/commit/
>57bcab050be336f0248b840eddf491912f2248a4
>
>This sets new CMake 2.8 policies to NEW behavior, but I have not
>tested whether this actually works on all platforms.  I'd appreciate it
>if some folks could report back whether things build with the patch so
>I can commit it to CVS.
>
>Sean, in the case you posted CXX_HAS_CPP_PRECOMP_FLAG gets set to
>true in the following block from VTK/CMake/vtkDetermineCompilerFlags.cmake:
>
>    # -no-cpp-precomp was a compiler flag present only in Apple's gcc and not
>    # in the FSF gcc. The flag is obsolete and totally removed in gcc 4.2
>    # and later. I believe it is only needed with gcc 3.3 and earlier.
>    INCLUDE(${VTK_SOURCE_DIR}/CMake/vtkCheckCXXAcceptsFlags.cmake)
>    vtkCHECK_CXX_ACCEPTS_FLAGS("-no-cpp-precomp" CXX_HAS_CPP_PRECOMP_FLAG)
>    IF(${CXX_HAS_CPP_PRECOMP_FLAG})
>      SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -no-cpp-precomp")
>      SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -no-cpp-precomp")
>    ENDIF(${CXX_HAS_CPP_PRECOMP_FLAG})

You know, I think it was me that wrote that comment actually. :)

>Does this flag actually exist on your compiler, or is the try-compile
>going wrong?

That flag no longer exists in the man page of gcc 4 or 4.2 on both 10.5
and 10.6.  The flag is obsolete.

Interestingly, gcc seems to accept any "-no" flag!

$ gcc-4.2 -foo /Users/sean/Desktop/test.c 
cc1: error: unrecognized command line option "-foo"
$ gcc-4.2 -no-foo /Users/sean/Desktop/test.c 

It seems to silently ignore it!  So I guess the try-compile is correct,
but not really reporting what we want.

In any case, it would appear that the intent of the above block is to
use the new policy, so your patch should be good.

However, I tried your patch and it seemed to make no difference.  Is it
possible your syntax is incorrect?  In any case, I added the simpler:

CMAKE_POLICY(SET CMP0012 NEW)
CMAKE_POLICY(SET CMP0013 NEW)
CMAKE_POLICY(SET CMP0014 NEW)

And now everything works without any warnings.

So, on Mac OS X 10.6 anyway, it seems safe to use these new policies in VTK.

Thanks!

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list