# Add more ion here
set(ION_NAMES nmccn qweather)
foreach(ION_NAME IN LISTS ION_NAMES)
  if(TARGET Plasma::Weather::IonLegacy AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plasma_engine_${ION_NAME}/CMakeLists.txt")
    message(DEBUG "Adding legacy Ion ${ION_NAME}...")
    add_subdirectory("plasma_engine_${ION_NAME}")
    if(TARGET "plasma_engine_${ION_NAME}")
      target_compile_definitions("plasma_engine_${ION_NAME}" PRIVATE KDE_WEATHER_TRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.weather\")
    endif()
  endif()
  if(TARGET Plasma::Weather::Ion AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ION_NAME}/CMakeLists.txt")
    message(DEBUG "Adding Ion ${ION_NAME}...")
    add_subdirectory("${ION_NAME}")
    if(TARGET "${ION_NAME}")
      target_compile_definitions("${ION_NAME}" PRIVATE KDE_WEATHER_TRANSLATION_DOMAIN=\"plasma_engine_weather\")
    endif()
  endif()
endforeach()
