# This file is provided with SMTK as an example of how to configure a plugin
# contract file. In general, SMTK should not contain these files. Instead, the
# dashboard computer that runs SMTK tests should be passed a list of URLs for
# plugin contract test files during its configuration.

cmake_minimum_required(VERSION 3.10)
project(model-viewer)

include(ExternalProject)

ExternalProject_Add(model-viewer
  URL @PROJECT_SOURCE_DIR@/applications/ModelViewer
  DOWNLOAD_NO_EXTRACT TRUET
  PREFIX plugin
  STAMP_DIR plugin/stamp
  SOURCE_DIR plugin/src
  BINARY_DIR plugin/build
  CMAKE_ARGS
    -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
    -Dsmtk_DIR=${smtk_DIR}
    ${response_file}
  INSTALL_DIR plugin/install
  INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target package
  TEST_BEFORE_INSTALL True
)
