Commit d4c336f3 authored by T.J. Corona's avatar T.J. Corona

Only build SMTK or CMB (with its own SMTK).

parent 641ef71d
Pipeline #117901 running with stage
......@@ -72,6 +72,7 @@ function (superbuild_find_projects var)
qt5
remus
smtk
smtkonly
smtkusersguide
szip
vtk
......@@ -111,16 +112,13 @@ function (superbuild_sanity_check)
message(FATAL_ERROR
"Only one of the following projects should be enabled: vtkonly, paraview.")
endif ()
if (NOT smtk_enabled AND NOT cmb_enabled)
if (smtkonly_enabled AND cmb_enabled)
message(FATAL_ERROR
"At least one of the following projects must be enabled: cmb, smtk.")
"Only one of the following projects should be enabled: smtkonly, cmb.")
endif ()
if (smtk_enabled AND
smtk_SOURCE_SELECTION STREQUAL "from_cmb" AND
NOT DEVELOPER_MODE_smtk AND
(NOT cmb_enabled OR DEVELOPER_MODE_cmb))
if (NOT smtkonly_enabled AND NOT cmb_enabled)
message(FATAL_ERROR
"SMTK cannot use CMB's SMTK submodule without CMB being enabled and built by the superbuild.")
"At least one of the following projects must be enabled: cmb, smtk.")
endif ()
endfunction ()
......@@ -169,7 +167,7 @@ endfunction ()
macro (superbuild_setup_tests)
if (cmb_enabled)
set(DROP_LOCATION "/submit.php?project=CMB")
elseif (smtk_enabled)
elseif (smtkonly_enabled)
set(DROP_LOCATION "/submit.php?project=SMTK")
endif ()
endmacro ()
......@@ -177,7 +175,7 @@ endmacro ()
function (superbuild_add_tests)
set_property(GLOBAL APPEND
PROPERTY
superbuild_test_projects cmb smtk)
superbuild_test_projects cmb smtkonly)
endfunction ()
set(CMB_TEST_DATA_ROOT "" CACHE PATH "Location of CMB's testing data")
......@@ -246,12 +244,3 @@ list(APPEND superbuild_ctest_custom_files
list(APPEND superbuild_project_roots
"${CMAKE_CURRENT_LIST_DIR}/projects")
add_subdirectory(superbuild)
if (TARGET "smtk" AND NOT DEVELOPER_MODE_smtk AND smtk_SOURCE_SELECTION STREQUAL "from_cmb")
get_property(smtk_need_cmb_download GLOBAL
PROPERTY smtk_need_cmb_download)
if (smtk_need_cmb_download)
add_dependencies("smtk"
"cmb-download")
endif ()
endif ()
......@@ -26,15 +26,16 @@ endif ()
get_property(cmb_lfs_steps GLOBAL
PROPERTY cmb_superbuild_lfs_steps)
include(smtk.deps)
superbuild_add_project(cmb
DEVELOPER_MODE
DEBUGGABLE
DEFAULT_ON
INDEPENDENT_STEP_TARGETS ${cmb_lfs_steps} download update
DEPENDS boost moab remus vxl nlohmannjson python paraview pybind11
qt qt5 zeromq cmbworkflows cmbusersguide smtkusersguide
DEPENDS_OPTIONAL smtk cgm cumulus ${cmb_extra_optional_dependencies}
cxx11 gdal hdf5 netcdf opencv
DEPENDS python paraview pybind11 qt qt5 cmbworkflows cmbusersguide smtk
${smtk_dependencies} smtkusersguide
DEPENDS_OPTIONAL ${cmb_extra_optional_dependencies} ${smtk_optional_dependencies}
CMAKE_ARGS
${cmb_extra_cmake_args}
-DKML_DIR:PATH=<INSTALL_DIR>
......
set(smtk_extra_cmake_args)
if (WIN32)
# On Windows we expect the Python source for module to be
# in a different place than Unix builds and in a different
# place than SMTK would put it by default. Tell SMTK where
# to install Python source for the smtk module:
list(APPEND smtk_extra_cmake_args
"-DSMTK_PYTHON_MODULEDIR:PATH=bin/Lib/site-packages")
if (smtk_enabled AND NOT (smtkonly_enabled OR cmb_enabled))
message(FATAL_ERROR
"SMTK is enabled, but neither smtkonly nor cmb has been enabled.")
endif ()
set(smtk_enable_python_wrapping)
if (pybind11_enabled)
set(smtk_enable_python_wrapping ON)
endif ()
set(smtk_enable_vtk OFF)
if (vtkonly_enabled OR paraview_enabled)
set(smtk_enable_vtk ON)
endif ()
if (UNIX AND NOT APPLE)
list(APPEND smtk_extra_cmake_args
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE)
endif ()
set(smtk_response_file)
if (WIN32)
# Force response file usage in SMTK. 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(smtk_response_file -DCMAKE_NINJA_FORCE_RESPONSE_FILE:BOOL=ON)
endif ()
get_property(smtk_lfs_steps GLOBAL
PROPERTY cmb_superbuild_lfs_steps)
#explicitly depend on gdal so we inherit the location of the GDAL library
#which FindGDAL.cmake fails to find, even when given GDAL_DIR.
superbuild_add_project(smtk
DEVELOPER_MODE
DEBUGGABLE
DEFAULT_ON
INDEPENDENT_STEP_TARGETS ${smtk_lfs_steps} download update
DEPENDS boost cxx11 eigen hdf5 moab netcdf nlohmannjson
DEPENDS_OPTIONAL cgm cumulus gdal netcdf opencv paraview pybind11 python
matplotlib remus qt qt5 vtkonly vxl
CMAKE_ARGS
${smtk_extra_cmake_args}
-DBUILD_SHARED_LIBS:BOOL=ON
-DSMTK_ENABLE_OPENCV:BOOL=${opencv_enabled}
-DSMTK_ENABLE_QT_SUPPORT:BOOL=${qt_enabled}
-DSMTK_ENABLE_VTK_SUPPORT:BOOL=${smtk_enable_vtk}
-DSMTK_ENABLE_VXL_SUPPORT:BOOL=${vxl_enabled}
-DSMTK_ENABLE_PARAVIEW_SUPPORT:BOOL=${paraview_enabled}
-DSMTK_ENABLE_CGM_SESSION:BOOL=${cgm_enabled}
-DSMTK_ENABLE_DISCRETE_SESSION:BOOL=${smtk_enable_vtk}
-DSMTK_ENABLE_EXODUS_SESSION:BOOL=${paraview_enabled}
-DSMTK_ENABLE_REMOTE_SESSION:BOOL=${remus_enabled}
-DSMTK_ENABLE_REMUS_SUPPORT:BOOL=${remus_enabled}
-DSMTK_ENABLE_PYTHON_WRAPPING:BOOL=${smtk_enable_python_wrapping}
-DSMTK_ENABLE_MATPLOTLIB:BOOL=${matplotlib_enabled}
-DSMTK_USE_PYBIND11:BOOL=${pybind11_enabled}
# SMTK_USE_SYSTEM_MOAB should go away after CMB's SMTK is bumped to master:
-DSMTK_USE_SYSTEM_MOAB:BOOL=ON
-DPYBIND11_INSTALL:BOOL=${pybind11_enabled}
-DSMTK_QT_VERSION:STRING=5
-DSMTK_DATA_DIR:PATH=${CMB_TEST_DATA_ROOT}
# 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
# GDAL bits to properly enable gdal classes ( mainly wrapper )
# that we need to build
-DGDAL_DIR:PATH=<INSTALL_DIR>
include(smtk.deps)
# Cumulus bits
-DSMTK_ENABLE_CUMULUS_SUPPORT:BOOL=${cumulus_enabled}
# Set CMAKE_INSTALL_LIBDIR to "lib" for all projects in the superbuild to
# override OS-specific libdirs that GNUInstallDirs.cmake would otherwise
# set.
-DCMAKE_INSTALL_LIBDIR:STRING=lib
${smtk_response_file})
if (WIN32)
set(smtk_cmakedir bin/cmake)
else ()
set(smtk_cmakedir lib/cmake)
endif ()
superbuild_add_extra_cmake_args(
-DSMTK_DIR:PATH=<INSTALL_DIR>/${smtk_cmakedir}/SMTK)
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 ()
set(smtk_can_lfs FALSE)
set(smtk_lfs_depends)
if (smtk_SOURCE_SELECTION STREQUAL "git")
set(smtk_can_lfs TRUE)
elseif (smtk_SOURCE_SELECTION STREQUAL "source")
if (EXISTS "${smtk_SOURCE_DIR}/.git")
set(smtk_can_lfs TRUE)
endif ()
elseif (smtk_SOURCE_SELECTION STREQUAL "from_cmb")
if (EXISTS "${smtk_source_dir}/thirdparty/smtk/.git" OR
cmb_SOURCE_SELECTION STREQUAL "git")
set(smtk_can_lfs TRUE)
endif ()
if (cmb_SOURCE_SELECTION STREQUAL "git")
# This is unfortunately necessary since the custom command is generated
# deep in the common-superbuild/ExternalProject infrastructure. A more
# proper solution would be to get the stamp file for each step and use
# `add_custom_command(APPEND)` to amend the dependencies for the `lfs-init`
# step to depend on the stamp file for the download step of CMB, but since
# CMB's target has not yet been declared, we can't query it here and the
# custom command doesn't exist at the top-level (where other `from_cmb`
# logic exists.
list(APPEND smtk_lfs_depends
"${CMAKE_BINARY_DIR}/superbuild/cmb/stamp/cmb-download")
endif ()
endif ()
option(smtk_FETCH_LFS "Fetch LFS data for CMB" OFF)
if (smtk_enabled AND smtk_can_lfs AND smtk_FETCH_LFS)
cmb_superbuild_add_lfs_steps(smtk ${smtk_lfs_depends})
endif ()
superbuild_add_dummy_project(smtk
DEPENDS ${smtk_dependencies}
DEPENDS_OPTIONAL ${smtk_optional_dependencies})
# Both build targets <smtkonly> and <cmb> build SMTK and therefore need to
# directly depend on the projects that SMTK requires (project A's build flags
# are only passed to project B if project B directly depends on project A; if
# project C depends on project B, then it will not receive project A's build
# flags). Since the dummy build target <smtk> appears in the dependency graph
# before both <smtkonly> and <cmb>, we construct global properties for SMTK's
# required and optional dependencies here and refer to them when describing the
# build targets <smtkonly> and <cmb>.
set(smtk_dependencies
boost cxx11 eigen hdf5 moab netcdf nlohmannjson remus)
set(smtk_optional_dependencies
cgm cumulus gdal netcdf opencv paraview pybind11 python matplotlib remus
qt qt5 vtkonly vxl)
set(smtk_extra_cmake_args)
if (WIN32)
# On Windows we expect the Python source for module to be
# in a different place than Unix builds and in a different
# place than SMTK would put it by default. Tell SMTK where
# to install Python source for the smtk module:
list(APPEND smtk_extra_cmake_args
"-DSMTK_PYTHON_MODULEDIR:PATH=bin/Lib/site-packages")
endif ()
set(smtk_enable_python_wrapping)
if (pybind11_enabled)
set(smtk_enable_python_wrapping ON)
endif ()
set(smtk_enable_vtk OFF)
if (vtkonly_enabled OR paraview_enabled)
set(smtk_enable_vtk ON)
endif ()
if (UNIX AND NOT APPLE)
list(APPEND smtk_extra_cmake_args
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE)
endif ()
set(smtk_response_file)
if (WIN32)
# Force response file usage in SMTK. 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(smtk_response_file -DCMAKE_NINJA_FORCE_RESPONSE_FILE:BOOL=ON)
endif ()
get_property(smtk_lfs_steps GLOBAL
PROPERTY cmb_superbuild_lfs_steps)
include(smtk.deps)
#explicitly depend on gdal so we inherit the location of the GDAL library
#which FindGDAL.cmake fails to find, even when given GDAL_DIR.
superbuild_add_project(smtkonly
DEVELOPER_MODE
DEBUGGABLE
INDEPENDENT_STEP_TARGETS ${smtk_lfs_steps} download update
DEPENDS smtk ${smtk_dependencies}
DEPENDS_OPTIONAL ${smtk_optional_dependencies}
CMAKE_ARGS
${smtk_extra_cmake_args}
-DBUILD_SHARED_LIBS:BOOL=ON
-DSMTK_ENABLE_OPENCV:BOOL=${opencv_enabled}
-DSMTK_ENABLE_QT_SUPPORT:BOOL=${qt_enabled}
-DSMTK_ENABLE_VTK_SUPPORT:BOOL=${smtk_enable_vtk}
-DSMTK_ENABLE_VXL_SUPPORT:BOOL=${vxl_enabled}
-DSMTK_ENABLE_PARAVIEW_SUPPORT:BOOL=${paraview_enabled}
-DSMTK_ENABLE_CGM_SESSION:BOOL=${cgm_enabled}
-DSMTK_ENABLE_DISCRETE_SESSION:BOOL=${smtk_enable_vtk}
-DSMTK_ENABLE_EXODUS_SESSION:BOOL=${paraview_enabled}
-DSMTK_ENABLE_REMOTE_SESSION:BOOL=${remus_enabled}
-DSMTK_ENABLE_REMUS_SUPPORT:BOOL=${remus_enabled}
-DSMTK_ENABLE_PYTHON_WRAPPING:BOOL=${smtk_enable_python_wrapping}
-DSMTK_ENABLE_MATPLOTLIB:BOOL=${matplotlib_enabled}
-DSMTK_USE_PYBIND11:BOOL=${pybind11_enabled}
# SMTK_USE_SYSTEM_MOAB should go away after CMB's SMTK is bumped to master:
-DSMTK_USE_SYSTEM_MOAB:BOOL=ON
-DPYBIND11_INSTALL:BOOL=${pybind11_enabled}
-DSMTK_QT_VERSION:STRING=5
-DSMTK_DATA_DIR:PATH=${CMB_TEST_DATA_ROOT}
# 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
# GDAL bits to properly enable gdal classes ( mainly wrapper )
# that we need to build
-DGDAL_DIR:PATH=<INSTALL_DIR>
# Cumulus bits
-DSMTK_ENABLE_CUMULUS_SUPPORT:BOOL=${cumulus_enabled}
# Set CMAKE_INSTALL_LIBDIR to "lib" for all projects in the superbuild to
# override OS-specific libdirs that GNUInstallDirs.cmake would otherwise
# set.
-DCMAKE_INSTALL_LIBDIR:STRING=lib
${smtk_response_file})
if (WIN32)
set(smtk_cmakedir bin/cmake)
else ()
set(smtk_cmakedir lib/cmake)
endif ()
superbuild_add_extra_cmake_args(
-DSMTK_DIR:PATH=<INSTALL_DIR>/${smtk_cmakedir}/SMTK)
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 ()
set(smtk_can_lfs FALSE)
set(smtk_lfs_depends)
if (smtk_SOURCE_SELECTION STREQUAL "git")
set(smtk_can_lfs TRUE)
elseif (smtk_SOURCE_SELECTION STREQUAL "source")
if (EXISTS "${smtk_SOURCE_DIR}/.git")
set(smtk_can_lfs TRUE)
endif ()
endif ()
option(smtk_FETCH_LFS "Fetch LFS data for CMB" OFF)
if (smtkohly_enabled AND smtk_can_lfs AND smtk_FETCH_LFS)
cmb_superbuild_add_lfs_steps(smtkonly ${smtk_lfs_depends})
endif ()
......@@ -27,29 +27,13 @@ superbuild_set_selectable_source(cmb
SELECT source CUSTOMIZABLE
SOURCE_DIR "source-cmb")
set(smtk_source_dir)
if (cmb_SOURCE_SELECTION STREQUAL "source")
set(smtk_source_dir
"${cmb_SOURCE_DIR}")
else ()
set(smtk_source_dir
"${CMAKE_BINARY_DIR}/superbuild/cmb/src")
set_property(GLOBAL
PROPERTY
smtk_need_cmb_download TRUE)
endif ()
superbuild_set_selectable_source(smtk
superbuild_set_selectable_source(smtkonly
SELECT 2.0.0
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/smtk.git"
GIT_TAG "v2.0.0"
SELECT git CUSTOMIZABLE
SELECT git CUSTOMIZABLE DEFAULT
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/smtk.git"
GIT_TAG "origin/master"
SELECT from_cmb DEFAULT
DOWNLOAD_COMMAND
"${CMAKE_COMMAND}" -E echo_append
SOURCE_DIR "${smtk_source_dir}/thirdparty/smtk"
SELECT source CUSTOMIZABLE
SOURCE_DIR "source-smtk")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment