add_library(smtkTruchas SHARED Registrar.cxx)

target_link_libraries(smtkTruchas
  PUBLIC
    smtkCore
  PRIVATE
    ${__dependencies}
)

target_include_directories(smtkTruchas PUBLIC
  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
  $<INSTALL_INTERFACE:include>
  PRIVATE
)
generate_export_header(smtkTruchas EXPORT_FILE_NAME Exports.h)

smtk_get_kit_name(name dir_prefix)

# Install the header files
install(
  FILES
    Registrar.h
    ${CMAKE_CURRENT_BINARY_DIR}/Exports.h
  DESTINATION
    include/${PROJECT_NAME}/${PROJECT_VERSION}/${dir_prefix})

# Install the library and exports
install(
  TARGETS smtkTruchas
  EXPORT  Truchas
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin
  PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}/${PROJECT_VERSION}/${dir_prefix})


if (ParaView_FOUND AND Qt5_FOUND AND TARGET smtkQtExt)
  add_subdirectory(qt)
endif()

if (ParaView_FOUND AND TARGET smtkPluginSupport)
  add_subdirectory(plugin)
endif()

if (ENABLE_TESTING)
  add_subdirectory(testing)
endif()

if (Qt5_FOUND AND BUILD_EXAMPLES)
  add_subdirectory(examples)
endif()
