[CMake] if/else statment based on VTK version

Kathryn Hayes hayes at bwh.harvard.edu
Mon May 22 14:42:20 EDT 2006


Awesome.  Thanks!

Katie

On Mon, 22 May 2006, Brad King wrote:

> Kathryn Hayes wrote:
> > We're building teem against VTK 4 and VTK 5, and it looks like we're going
> > to build it with different flags depending on the VTK version to get it to
> > compile.  Is there a good way to test for the VTK version in CMake so we
> > can use the same CMakeLists.txt for both cases?
>
> FIND_PACKAGE(VTK)
> IF("${VTK_MAJOR_VERSION}" EQUAL 5)
>    SET(MYPROJ_VTK_5 1)
> ELSE("${VTK_MAJOR_VERSION}" EQUAL 5)
>    SET(MYPROJ_VTK_5 0)
> ENDIF("${VTK_MAJOR_VERSION}" EQUAL 5)
>
> -Brad
>


More information about the CMake mailing list