CMakeLists.txt 3.2 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.11)
2

3 4
if (POLICY CMP0025)
  # Clang and AppleClang are now unique compiler ids
5
  cmake_policy(SET CMP0025 NEW)
6 7
endif ()

8 9 10 11 12 13
project(cmb-superbuild)

macro (superbuild_setup_variables)
  include(SuperbuildVersionMacros)
  superbuild_set_version_variables(cmb "4.0.0" "cmb-version.cmake")
  set(cmb_version "${cmb_version_major}.${cmb_version_minor}")
14
  superbuild_set_version_variables(paraview "5.1.2" "paraview-version.cmake")
15 16 17 18 19 20 21
  set(paraview_version "${paraview_version_major}.${paraview_version_minor}")
endmacro ()

function (superbuild_find_projects var)
  set(projects
    boost
    bzip2
Ben Boeckel's avatar
Ben Boeckel committed
22
    cgm
23 24
    cmb
    cmbworkflows
Ben Boeckel's avatar
Ben Boeckel committed
25
    cxx11
26
    freetype
Ben Boeckel's avatar
Ben Boeckel committed
27
    ftgl
28 29 30 31 32
    gdal
    hdf5
    kml
    moab
    netcdf
Jacob Becker's avatar
Jacob Becker committed
33
    numpy
Ben Boeckel's avatar
Ben Boeckel committed
34
    oce
35 36
    opencv
    opencvcontrib
37 38 39
    paraview
    png
    python
40 41
    pythongirderclient
    pythonrequests
42
    pythonsetuptools
43
    pythonsix
44 45 46 47 48 49 50 51 52
    qt4
    remus
    shiboken
    smtk
    szip
    vxl
    zeromq
    zlib)

53 54 55 56 57 58
  if (NOT WIN32)
    list(APPEND projects
      fontconfig
      libxml2)
  endif ()

59 60
  if (WIN32)
    list(APPEND projects
61
      ftjam
62 63 64
      pythonsetuptools)
  endif ()

65 66 67 68 69 70
  option(USE_NONFREE_COMPONENTS "Enable the non-free parts of the superbuild" OFF)
  mark_as_advanced(USE_NONFREE_COMPONENTS)
  if (USE_NONFREE_COMPONENTS)
    list(APPEND projects
      triangle)
  endif ()
71

72 73 74 75
  set("${var}"
    ${projects}
    PARENT_SCOPE)
endfunction ()
76

77 78 79 80 81 82 83
function (superbuild_sanity_check)
  if (NOT smtk_enabled AND NOT cmb_enabled)
    message(FATAL_ERROR
      "At least one of the following projects must be enabled: cmb, smtk.")
  endif ()
endfunction ()

84
function (superbuild_add_packaging)
85 86 87 88
  if (NOT cmb_enabled OR DEVELOPER_MODE_cmb)
    return ()
  endif ()

89 90 91 92 93 94 95 96 97 98 99
  if (WIN32)
    set(generators
      ZIP)
  elseif (APPLE)
    set(generators
      DragNDrop)
  else ()
    set(generators
      TGZ)
  endif ()

100 101 102 103 104
  if (USE_SYSTEM_qt4)
    list(APPEND superbuild_export_variables
      QT_LIBRARY_DIR)
  endif ()

105
  foreach (generator IN LISTS generators)
Ben Boeckel's avatar
Ben Boeckel committed
106 107 108 109 110 111
    superbuild_add_extra_package_test(modelbuilder "${generator}"
      LABELS  "CMB"
      TIMEOUT 1200)
    superbuild_add_extra_package_test(hydrology "${generator}"
      LABELS  "CMB"
      TIMEOUT 1200)
112
  endforeach ()
113
endfunction ()
114

115 116
macro (superbuild_setup_tests)
  if (cmb_enabled)
117
    set(DROP_LOCATION "/submit.php?project=CMB")
118
  elseif (smtk_enabled)
119
    set(DROP_LOCATION "/submit.php?project=SMTK")
120 121 122
  endif ()
endmacro ()

123 124 125 126 127
function (superbuild_add_tests)
  set_property(GLOBAL APPEND
    PROPERTY
      superbuild_test_projects cmb smtk)
endfunction ()
128

129 130
set(CMB_TEST_DATA_ROOT "" CACHE PATH "Location of CMB's testing data")

131 132 133 134 135 136 137
set(boost_libraries
  atomic
  chrono
  date_time
  filesystem
  system
  thread)
138

139 140 141 142 143
configure_file(
  "${CMAKE_CURRENT_LIST_DIR}/cmake/CTestCustom.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom-cmb.cmake"
  @ONLY)

144 145 146 147
if (__BUILDBOT_INSTALL_LOCATION)
  set(superbuild_install_location "${__BUILDBOT_INSTALL_LOCATION}")
endif ()

148 149 150 151 152 153 154
list(APPEND superbuild_version_files
  "${CMAKE_CURRENT_LIST_DIR}/versions.cmake")
list(APPEND extra_ctest_custom_files
  "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom-cmb.cmake")
list(APPEND superbuild_project_roots
  "${CMAKE_CURRENT_LIST_DIR}/projects")
add_subdirectory(superbuild)