From 7b23ac7503e50f376ac6084580f4f4e3fa88e8c4 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Wed, 25 Nov 2015 08:13:27 +0000 Subject: [PATCH] ENH: runTimePostProcessing - updated CMakeLists.txt for cmake > 3 --- .../graphics/runTimePostProcessing/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/CMakeLists.txt b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/CMakeLists.txt index b2afd1e03d..903942b305 100644 --- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/CMakeLists.txt +++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/CMakeLists.txt @@ -2,22 +2,26 @@ cmake_minimum_required(VERSION 2.8) project(runTimePostProcessing) -if (EXISTS $ENV{VTK_DIR}) +# Set policy for CMP0002 needed for cmake > 3 +cmake_policy(SET CMP0002 OLD) + +if (EXISTS "$ENV{VTK_DIR}") message("Building with VTK from $ENV{VTK_DIR}") find_package(VTK REQUIRED HINTS $ENV{VTK_DIR}) include(${VTK_USE_FILE}) - -else (EXISTS $ENV{ParaView_DIR}) +elseif (EXISTS "$ENV{ParaView_DIR}") message("Building with Paraview from $ENV{ParaView_DIR}") find_package(ParaView REQUIRED) include(${VTK_USE_FILE}) - set( VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}" ) -endif (EXISTS $ENV{VTK_DIR}) +else () + message (FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR") +endif () include(CMakeLists-Common.txt) + #-----------------------------------------------------------------------------