Commit fc4d87b1 authored by Ben Boeckel's avatar Ben Boeckel

smtk: support using CMB's submodule

parent 99260206
......@@ -102,6 +102,11 @@ function (superbuild_sanity_check)
message(FATAL_ERROR
"At least one of the following projects must be enabled: cmb, smtk.")
endif ()
if (smtk_SOURCE_SELECTION STREQUAL "from_cmb" AND NOT DEVELOPER_MODE_smtk AND
(NOT cmb_enabled OR DEVELOPER_MODE_cmb))
message(FATAL_ERROR
"SMTK cannot use CMB's SMTK submodule without CMB being enabled and built by the superbuild.")
endif ()
if (shiboken_enabled AND pybind11_enabled)
message(FATAL_ERROR
"Only one python wrapping protocol should be enabled: pybind11, shiboken.")
......@@ -236,3 +241,12 @@ 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)
get_property(smtk_need_cmb_download GLOBAL
PROPERTY smtk_need_cmb_download)
if (smtk_need_cmb_download)
add_dependencies("smtk"
"cmb-download")
endif ()
endif ()
......@@ -32,6 +32,18 @@ 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
SOURCE_DIR "${cmb_SOURCE_DIR}")
else ()
set(smtk_source_dir
SOURCE_DIR "${CMAKE_BINARY_DIR}/superbuild/cmb/src")
set_property(GLOBAL
PROPERTY
smtk_need_cmb_download TRUE)
endif ()
superbuild_set_selectable_source(smtk
SELECT 1.1.0 DEFAULT
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/smtk.git"
......@@ -39,6 +51,11 @@ superbuild_set_selectable_source(smtk
SELECT git CUSTOMIZABLE
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/smtk.git"
GIT_TAG "origin/master"
SELECT from_cmb
DOWNLOAD_COMMAND
"${CMAKE_COMMAND}" -E echo_append
SOURCE_DIR "${smtk_source_dir}"
SOURCE_SUBDIR "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