cmb.cmake 2.72 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
superbuild_add_project(cmb
  DEVELOPER_MODE
31
  DEBUGGABLE
32
  DEFAULT_ON
33
  INDEPENDENT_STEP_TARGETS ${cmb_lfs_steps} download update
34
  DEPENDS boost moab remus vxl nlohmannjson python paraview pybind11
T.J. Corona's avatar
T.J. Corona committed
35 36
          qt qt5 smtk zeromq cmbworkflows cmbusersguide smtkusersguide
  DEPENDS_OPTIONAL cumulus ${cmb_extra_optional_dependencies}
37
                   cxx11 gdal hdf5 netcdf opencv
38
  CMAKE_ARGS
39
    ${cmb_extra_cmake_args}
40 41 42
    -DBUILD_TESTING:BOOL=${BUILD_TESTING}
    -Dcmb_enable_testing:BOOL=${TEST_cmb}

43 44
    -DKML_DIR:PATH=<INSTALL_DIR>
    -DGDAL_DIR:PATH=<INSTALL_DIR>
45
    -DCMB_TEST_DATA_ROOT:PATH=${CMB_TEST_DATA_ROOT}
46
    -DPARAVIEW_QT_VERSION:STRING=${qt_version}
47 48

    #specify semi-colon separated paths for session plugins
49
    -Dcmb_test_plugin_paths:STRING=<INSTALL_DIR>/${cmb_test_plugin_dir}
50 51 52 53 54

    # 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 58 59
    -DSMTK_ENABLE_TESTING:BOOL=${Test_SMTK}

    # Pass Cumulus flag to smtk
    -DSMTK_ENABLE_CUMULUS_SUPPORT:BOOL=${cumulus_enabled}

60 61
    -DCMB_SUPERBUILD_DEVELOPER_ROOT:PATH=<INSTALL_DIR>

62 63 64
    # Set CMAKE_INSTALL_LIBDIR to "lib" for all projects in the superbuild to
    # override OS-specific libdirs that GNUInstallDirs.cmake would otherwise
    # set.
65 66
    -DCMAKE_INSTALL_LIBDIR:STRING=lib

67
    ${cmb_response_file})
68 69 70 71 72

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 ()
73 74 75 76 77 78 79 80 81 82 83

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)
84
if (cmb_enabled AND cmb_can_lfs AND cmb_FETCH_LFS)
85 86
  cmb_superbuild_add_lfs_steps(cmb)
endif ()