#-----------------------------------------------------------------------------
# Create target
#-----------------------------------------------------------------------------

file(GLOB VTK_H_FILES VTKRenderer/imstk*.h)
file(GLOB VTK_CPP_FILES VTKRenderer/imstk*.cpp)

file(GLOB SIMMANAGER_H_FILES imstk*.h)
file(GLOB SIMMANAGER_CPP_FILES imstk*.cpp)

set(SIMULATIONMANAGER_H_FILES ${SIMMANAGER_H_FILES} ${VTK_H_FILES})
set(SIMULATIONMANAGER_CPP_FILES ${SIMMANAGER_CPP_FILES} ${VTK_CPP_FILES})
set(SIMULATIONMANAGER_SUBDIR
  VTKRenderer)

include(imstkAddLibrary)
imstk_add_library(SimulationManager
  H_FILES
    ${SIMULATIONMANAGER_H_FILES}
  CPP_FILES
    ${SIMULATIONMANAGER_CPP_FILES}
  SUBDIR_LIST
    ${SIMULATIONMANAGER_SUBDIR}
  DEPENDS
    Scene
    Rendering
  )

# Install VR actions json
file(GLOB VTK_VR_JSON_FILES VTKRenderer/vtk_openvr_*.json)
if (MSVC)
  # Show them in visual studios
  target_sources(SimulationManager PRIVATE ${VTK_VR_JSON_FILES})
  set_source_files_properties(${VTK_VR_JSON_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()
install(FILES ${VTK_VR_JSON_FILES} DESTINATION bin)

#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if( ${PROJECT_NAME}_BUILD_TESTING )
  add_subdirectory(Testing)
endif()