cmb.cmake 3.75 KB
Newer Older
1 2 3 4 5 6
set(cmb_extra_optional_dependencies)
if (USE_NONFREE_COMPONENTS)
  list(APPEND cmb_extra_optional_dependencies
    triangle)
endif ()

7 8 9 10 11
set(cmb_test_plugin_dir lib)
if (WIN32)
  set(cmb_test_plugin_dir bin)
endif()

12
set(cmb_response_file)
13
if (WIN32)
14 15 16 17
  # Force response file usage in CMB. The command line gets way too long on
  # Windows without this. Once VTK_USE_FILE and PARAVIEW_USE_FILE are gone,
  # this can be removed again.
  set(cmb_response_file -DCMAKE_NINJA_FORCE_RESPONSE_FILE:BOOL=ON)
18 19
endif ()

20 21 22 23 24 25
set(cmb_extra_cmake_args)
if (UNIX AND NOT APPLE)
  list(APPEND cmb_extra_cmake_args
    -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE)
endif ()

26 27 28
get_property(cmb_lfs_steps GLOBAL
  PROPERTY cmb_superbuild_lfs_steps)

29 30
include(smtk.deps)

31 32
superbuild_add_project(cmb
  DEVELOPER_MODE
33
  DEBUGGABLE
34
  DEFAULT_ON
35
  INDEPENDENT_STEP_TARGETS ${cmb_lfs_steps} download update
36 37 38
  DEPENDS python paraview pybind11 qt qt5 cmbworkflows cmbusersguide smtk
          ${smtk_dependencies} smtkusersguide
  DEPENDS_OPTIONAL ${cmb_extra_optional_dependencies} ${smtk_optional_dependencies}
39
  CMAKE_ARGS
40
    ${cmb_extra_cmake_args}
41 42
    -DKML_DIR:PATH=<INSTALL_DIR>
    -DGDAL_DIR:PATH=<INSTALL_DIR>
43
    -DCMB_TEST_DATA_ROOT:PATH=${CMB_TEST_DATA_ROOT}
44
    -DPARAVIEW_QT_VERSION:STRING=${qt_version}
45 46

    #specify semi-colon separated paths for session plugins
47
    -Dcmb_test_plugin_paths:STRING=<INSTALL_DIR>/${cmb_test_plugin_dir}
48 49 50 51 52 53 54
    #specify what mesh workers we should build
    -DBUILD_TRIANGLE_MESH_WORKER:BOOL=${triangle_enabled}

    # specify the apple app install prefix. No harm in specifying it for all
    # platforms.
    -DMACOSX_APP_INSTALL_PREFIX:PATH=<INSTALL_DIR>/Applications

55 56 57
    # This should be off by default because vtkCmbMoabReader in discrete
    # session may only be needed for debugging purpose
    -DSMTK_ENABLE_MOAB_DISCRETE_READER:BOOL=OFF
58

59 60 61 62 63 64 65 66 67 68
    -DSMTK_ENABLE_OPENCV:BOOL=${opencv_enabled}
    -DSMTK_ENABLE_QT_SUPPORT:BOOL=ON
    -DSMTK_ENABLE_VTK_SUPPORT:BOOL=ON
    -DSMTK_ENABLE_PARAVIEW_SUPPORT:BOOL=ON
    -DSMTK_ENABLE_CGM_SESSION:BOOL=${cgm_enabled}
    -DSMTK_ENABLE_DISCRETE_SESSION:BOOL=ON
    -DSMTK_ENABLE_EXODUS_SESSION:BOOL=ON
    -DSMTK_ENABLE_REMOTE_SESSION:BOOL=ON
    -DSMTK_ENABLE_REMUS_SUPPORT:BOOL=ON
    -DSMTK_ENABLE_PYTHON_WRAPPING:BOOL=${smtk_enable_python_wrapping}
69
    -DSMTK_ENABLE_VXL_SUPPORT:BOOL=${vxl_enabled}
70 71
    -DSMTK_USE_PYBIND11:BOOL=ON
    -DSMTK_QT_VERSION:STRING=5
72
    -DSMTK_DATA_DIR:PATH=${CMB_TEST_DATA_ROOT}
73

74 75 76 77 78 79
    -DSMTK_USE_SYSTEM_MOAB:BOOL=${moab_enabled}
    -DMOAB_INCLUDE_DIR:PATH=<INSTALL_DIR>/include

    # SMTK bits
    -DUSE_SYSTEM_SMTK:BOOL=${smtk_enabled}
    -DENABLE_HDF5:BOOL=${hdf5_enabled}
80 81
    -DENABLE_NETCDF:BOOL=${netcdf_enabled}
    -DNETCDF_ROOT:PATH=<INSTALL_DIR>
82

83
    # Cumulus bits
84
    -DSMTK_ENABLE_CUMULUS_SUPPORT:BOOL=${cumulus_enabled}
85 86
    -DENABLE_Cumulus:BOOL=${cumulus_enabled}

87 88
    -DCMB_SUPERBUILD_DEVELOPER_ROOT:PATH=<INSTALL_DIR>

89 90 91
    # Set CMAKE_INSTALL_LIBDIR to "lib" for all projects in the superbuild to
    # override OS-specific libdirs that GNUInstallDirs.cmake would otherwise
    # set.
92 93
    -DCMAKE_INSTALL_LIBDIR:STRING=lib

94
    ${cmb_response_file})
95 96 97 98 99

if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0") OR
    (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5"))
 superbuild_append_flags(cxx_flags "-Wno-inconsistent-missing-override" PROJECT_ONLY)
endif ()
100 101 102 103 104 105 106 107 108 109 110

set(cmb_can_lfs FALSE)
if (cmb_SOURCE_SELECTION STREQUAL "git")
  set(cmb_can_lfs TRUE)
elseif (cmb_SOURCE_SELECTION STREQUAL "source")
  if (EXISTS "${cmb_SOURCE_DIR}/.git")
    set(cmb_can_lfs TRUE)
  endif ()
endif ()

option(cmb_FETCH_LFS "Fetch LFS data for CMB" OFF)
111
if (cmb_enabled AND cmb_can_lfs AND cmb_FETCH_LFS)
112 113
  cmb_superbuild_add_lfs_steps(cmb)
endif ()