INCLUDE_REGULAR_EXPRESSION("^(lex|vtk|png|j|Task|Pipe).*$")

IF (CMAKE_USE_PTHREADS)
   SET(VTK_HAS_THREADS 1)
ENDIF (CMAKE_USE_PTHREADS)
IF (CMAKE_USE_SPROC)
   SET(VTK_HAS_THREADS 1)
ENDIF (CMAKE_USE_SPROC)
IF (CMAKE_USE_WIN32_THREADS)
   SET(VTK_HAS_THREADS 1)
ENDIF (CMAKE_USE_WIN32_THREADS)

IF (VTK_HAS_THREADS OR VTK_USE_MPI)
  IF (VTK_USE_RENDERING)
    ADD_EXECUTABLE(ParallelIso ParallelIso.cxx)
    TARGET_LINK_LIBRARIES(ParallelIso vtkParallel vtkHybrid)
    IF(APPLE)
      TARGET_LINK_LIBRARIES(ParallelIso "-framework Carbon")
    ENDIF(APPLE)
  ENDIF (VTK_USE_RENDERING)

  SET(TaskPara_SRCS TaskParallelism.cxx task1.cxx task2.cxx)
  SET(TaskParaPorts_SRCS TaskParallelismWithPorts.cxx task3.cxx task4.cxx)
  SET(PipePara_SRCS PipelineParallelism.cxx pipe1.cxx pipe2.cxx)

  ADD_EXECUTABLE(TaskParallelism          ${TaskPara_SRCS})
  ADD_EXECUTABLE(TaskParallelismWithPorts ${TaskParaPorts_SRCS})
  ADD_EXECUTABLE(PipelineParallelism      ${PipePara_SRCS})

  TARGET_LINK_LIBRARIES (TaskParallelism          vtkParallel)
  TARGET_LINK_LIBRARIES (TaskParallelismWithPorts vtkParallel)
  TARGET_LINK_LIBRARIES (PipelineParallelism      vtkParallel)
  IF(APPLE)
   TARGET_LINK_LIBRARIES(TaskParallelism "-framework Carbon")
   TARGET_LINK_LIBRARIES(TaskParallelismWithPorts "-framework Carbon")
   TARGET_LINK_LIBRARIES(PipelineParallelism "-framework Carbon")
  ENDIF(APPLE)
ENDIF (VTK_HAS_THREADS OR VTK_USE_MPI)
