if(NOT TSD_CPP)
  return()
endif()

# TODO: Remove me when servers use the cmake config file.
# Currently, they use the logic in FindTango.cmake to local libtango, this will
# require updating TangoCMakeModules.
if (WIN32)
  set(CMAKE_CXX_STANDARD 17)
endif()

message(STATUS "Database")
if(TSD_DATABASE)
  add_subdirectory(database)
  list(APPEND BATCH_SCRIPTS start-db.bat)
endif()

message(STATUS "Starter")
add_subdirectory(starter)
list(APPEND BATCH_SCRIPTS start-starter.bat)

message(STATUS "Access Control")
if(TSD_TAC)
  add_subdirectory(tangoaccesscontrol)
endif()

message(STATUS "Test")
add_subdirectory(tangotest)
list(APPEND BATCH_SCRIPTS start-tangotest.bat)

message(STATUS "UniversalTest")
add_subdirectory(universaltest)
list(APPEND BATCH_SCRIPTS start-universaltest.bat)

if (WIN32)
    foreach(input ${BATCH_SCRIPTS})
        install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/${input}
                DESTINATION ${CMAKE_INSTALL_BINDIR})
    endforeach()
endif()
