cmake_minimum_required(VERSION 2.6)

PROJECT (Parallel3)

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (USE_VTK_FILE)
  INCLUDE(${USE_VTK_FILE})
ENDIF (USE_VTK_FILE)

IF (NOT VTK_USE_MPI)
  MESSAGE(STATUS
    "The VTK you are building these exercises against was not compiled with MPI enabled. You will not be able to run/compile the exercises for the 'Parallel' section of the course. Please recompile VTK with VTK_USE_MPI cmake variable turned on for these exercises to be built.")
ELSE (NOT VTK_USE_MPI)
  MESSAGE(STATUS "MPI Enabled.")
ENDIF (NOT VTK_USE_MPI)

OPTION(BUILD_ANSWERS "Build answers" OFF)

LINK_LIBRARIES( 
  vtkParallel
)

IF (VTK_USE_MPI)

  ADD_EXECUTABLE(parallel3 MACOSX_BUNDLE parallel3.cxx)

  IF(BUILD_ANSWERS)
    ADD_EXECUTABLE(parallel3Answer MACOSX_BUNDLE parallel3_answer.cxx)
  ENDIF(BUILD_ANSWERS)

ENDIF (VTK_USE_MPI)
