add_subdirectory(cp2k)
add_subdirectory(openmp)
add_subdirectory(dftbplus)
add_subdirectory(deepmd)

# Build only probes, then run discovery/link checks before building PIMD.
set(prebuild_probes "")
foreach(probe IN ITEMS dftbplus-link dftbplus-serial-disabled)
  if(TARGET ${probe})
    list(APPEND prebuild_probes ${probe})
  endif()
endforeach()
add_custom_target(check-prebuild
  COMMAND "${CMAKE_CTEST_COMMAND}" --test-dir "${PROJECT_BINARY_DIR}"
    -C "$<IF:$<BOOL:$<CONFIG>>,$<CONFIG>,Release>" -L prebuild --output-on-failure
  DEPENDS ${prebuild_probes}
  USES_TERMINAL)
