@@ -261,8 +261,8 @@ subroutine write_generated_outputs(unit_out, example_dir, example_name)
261261 logical :: file_exists
262262 character (len= 10 ) :: extension
263263
264- ! Find output files
265- call find_output_files(example_dir , example_name, media_files, n_media, &
264+ ! Find output files in build directory
265+ call find_output_files(' build/example/ ' // trim (example_name) , example_name, media_files, n_media, &
266266 pdf_files, n_pdf, txt_files, n_txt)
267267
268268 ! Add media outputs (PNG or MP4)
@@ -289,7 +289,7 @@ subroutine write_generated_outputs(unit_out, example_dir, example_name)
289289 write (unit_out, ' (A)' ) ' '
290290
291291 ! Add corresponding ASCII output
292- ascii_file = ' doc /example/' // trim (example_name) // ' /' // replace_extension(media_files(j), ' txt' )
292+ ascii_file = ' build /example/' // trim (example_name) // ' /' // replace_extension(media_files(j), ' txt' )
293293 inquire (file= trim (ascii_file), exist= file_exists)
294294 if (file_exists) then
295295 write (unit_out, ' (A)' ) ' ASCII output:'
@@ -372,54 +372,54 @@ subroutine scan_directory_for_media(dir, media_files, n_media)
372372
373373 n_media = 0
374374
375- ! Check each known pattern
376- select case (dir)
377- case (' example/fortran /animation' )
375+ ! Check each known pattern - extract example name from build path
376+ select case (trim ( dir) )
377+ case (' build/example /animation' )
378378 call add_if_exists(dir, ' wave_animation.mp4' , media_files, n_media)
379- case (' example/fortran /basic_plots' )
379+ case (' build/example /basic_plots' )
380380 call add_if_exists(dir, ' simple_plot.png' , media_files, n_media)
381381 call add_if_exists(dir, ' multi_line.png' , media_files, n_media)
382- case (' example/fortran /line_styles' )
382+ case (' build/example /line_styles' )
383383 call add_if_exists(dir, ' line_styles.png' , media_files, n_media)
384- case (' example/fortran /contour_demo' )
384+ case (' build/example /contour_demo' )
385385 call add_if_exists(dir, ' contour_gaussian.png' , media_files, n_media)
386386 call add_if_exists(dir, ' mixed_plot.png' , media_files, n_media)
387- case (' example/fortran /scale_examples' )
387+ case (' build/example /scale_examples' )
388388 call add_if_exists(dir, ' log_scale.png' , media_files, n_media)
389389 call add_if_exists(dir, ' symlog_scale.png' , media_files, n_media)
390- case (' example/fortran /marker_demo' )
390+ case (' build/example /marker_demo' )
391391 call add_if_exists(dir, ' scatter_plot.png' , media_files, n_media)
392392 call add_if_exists(dir, ' all_marker_types.png' , media_files, n_media)
393393 call add_if_exists(dir, ' marker_colors.png' , media_files, n_media)
394- case (' example/fortran /colored_contours' )
394+ case (' build/example /colored_contours' )
395395 call add_if_exists(dir, ' gaussian_default.png' , media_files, n_media)
396396 call add_if_exists(dir, ' ripple_jet.png' , media_files, n_media)
397397 call add_if_exists(dir, ' ripple_coolwarm.png' , media_files, n_media)
398398 call add_if_exists(dir, ' ripple_inferno.png' , media_files, n_media)
399399 call add_if_exists(dir, ' saddle_plasma.png' , media_files, n_media)
400- case (' example/fortran /legend_demo' )
400+ case (' build/example /legend_demo' )
401401 call add_if_exists(dir, ' basic_legend.png' , media_files, n_media)
402402 call add_if_exists(dir, ' legend_upper_left.png' , media_files, n_media)
403403 call add_if_exists(dir, ' legend_upper_right.png' , media_files, n_media)
404404 call add_if_exists(dir, ' legend_lower_left.png' , media_files, n_media)
405405 call add_if_exists(dir, ' legend_lower_right.png' , media_files, n_media)
406406 call add_if_exists(dir, ' multi_function_legend.png' , media_files, n_media)
407- case (' example/fortran /legend_box_demo' )
407+ case (' build/example /legend_box_demo' )
408408 call add_if_exists(dir, ' legend_box_demo_default.png' , media_files, n_media)
409409 call add_if_exists(dir, ' legend_box_demo_upper_left.png' , media_files, n_media)
410410 call add_if_exists(dir, ' legend_box_demo_lower_right.png' , media_files, n_media)
411- case (' example/fortran /format_string_demo' )
411+ case (' build/example /format_string_demo' )
412412 call add_if_exists(dir, ' format_string_demo.png' , media_files, n_media)
413- case (' example/fortran /pcolormesh_demo' )
413+ case (' build/example /pcolormesh_demo' )
414414 call add_if_exists(dir, ' pcolormesh_basic.png' , media_files, n_media)
415415 call add_if_exists(dir, ' pcolormesh_plasma.png' , media_files, n_media)
416416 call add_if_exists(dir, ' pcolormesh_sinusoidal.png' , media_files, n_media)
417- case (' example/fortran /streamplot_demo' )
417+ case (' build/example /streamplot_demo' )
418418 call add_if_exists(dir, ' streamplot_demo.png' , media_files, n_media)
419- case (' example/fortran /unicode_demo' )
419+ case (' build/example /unicode_demo' )
420420 call add_if_exists(dir, ' unicode_demo.png' , media_files, n_media)
421421 call add_if_exists(dir, ' math_examples.png' , media_files, n_media)
422- case (' example/fortran /stateful_streamplot' )
422+ case (' build/example /stateful_streamplot' )
423423 call add_if_exists(dir, ' stateful_streamplot.png' , media_files, n_media)
424424 case default
425425 ! For other examples, try the standard pattern
0 commit comments