catalyst.cmake 1.98 KB
Newer Older
Chet Nieter's avatar
Chet Nieter committed
1
set(PARAVIEW_CATALYST_EDITION "Essentials"
Ben Boeckel's avatar
Ben Boeckel committed
2
  CACHE STRING "The catalyst edition to build")
Chet Nieter's avatar
Chet Nieter committed
3
set_property(CACHE PARAVIEW_CATALYST_EDITION
Ben Boeckel's avatar
Ben Boeckel committed
4 5
  PROPERTY
    STRINGS Essentials Extras Rendering-Base)
Chet Nieter's avatar
Chet Nieter committed
6
option(PARAVIEW_CATALYST_PYTHON "Enable Python support in catalyst" ON)
Ben Boeckel's avatar
Ben Boeckel committed
7 8

set(catalyst_editions Base)
Ben Boeckel's avatar
Ben Boeckel committed
9
if (PARAVIEW_CATALYST_PYTHON)
Ben Boeckel's avatar
Ben Boeckel committed
10 11 12
  list(APPEND catalyst_editions
    Enable-Python)
endif ()
Ben Boeckel's avatar
Ben Boeckel committed
13
if (PARAVIEW_CATALYST_EDITION STREQUAL "Essentials")
Ben Boeckel's avatar
Ben Boeckel committed
14 15
  list(APPEND catalyst_editions
    Essentials)
Ben Boeckel's avatar
Ben Boeckel committed
16
elseif (PARAVIEW_CATALYST_EDITION STREQUAL "Extras")
Ben Boeckel's avatar
Ben Boeckel committed
17 18 19
  list(APPEND catalyst_editions
    Essentials
    Extras)
Ben Boeckel's avatar
Ben Boeckel committed
20
elseif (PARAVIEW_CATALYST_EDITION STREQUAL "Rendering-Base")
Ben Boeckel's avatar
Ben Boeckel committed
21 22 23 24
  list(APPEND catalyst_editions
    Essentials
    Extras
    Rendering-Base)
Ben Boeckel's avatar
Ben Boeckel committed
25
  if (PARAVIEW_CATALYST_PYTHON)
Ben Boeckel's avatar
Ben Boeckel committed
26 27 28
    list(APPEND catalyst_editions
      Rendering-Base-Python)
  endif ()
Ben Boeckel's avatar
Ben Boeckel committed
29 30
elseif (catalyst_enabled)
  message(FATAL_ERROR "Unknown catalyst edition set: ${PARAVIEW_CATALYST_EDITION}")
Ben Boeckel's avatar
Ben Boeckel committed
31 32 33 34 35 36 37 38 39
endif ()

set(catalyst_edition_args)
foreach (catalyst_edition IN LISTS catalyst_editions)
  list(APPEND catalyst_edition_args
    -i <SOURCE_DIR>/Catalyst/Editions/${catalyst_edition})
endforeach ()

set(catalyst_cmake_args
40
  -G "${CMAKE_GENERATOR}"
Ben Boeckel's avatar
Ben Boeckel committed
41 42 43 44 45 46 47 48
  -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=TRUE
  -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
  -DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
  -DCMAKE_C_FLAGS:STRING=${project_c_flags}
  -DCMAKE_CXX_FLAGS:STRING=${project_cxx_flags}
  -DCMAKE_SHARED_LINKER_FLAGS:STRING=${project_ld_flags})

Ben Boeckel's avatar
Ben Boeckel committed
49
superbuild_add_project(catalyst
50
  DEPENDS mpi python
Ben Boeckel's avatar
Ben Boeckel committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64
  CONFIGURE_COMMAND
    ${pv_python_executable} <SOURCE_DIR>/Catalyst/catalyze.py
      ${catalyst_edition_args}
      -r <SOURCE_DIR>
      -o <TMP_DIR>/catalyzed
  BUILD_COMMAND
    <TMP_DIR>/catalyzed/cmake.sh
      --cmake=${CMAKE_COMMAND}
      ${catalyst_cmake_args}
      <TMP_DIR>/catalyzed
  INSTALL_COMMAND
    ${CMAKE_COMMAND}
      --build <BINARY_DIR>
      --target install
Ben Boeckel's avatar
Ben Boeckel committed
65
      -- -j${SUPERBUILD_PROJECT_PARALLELISM})