# executable for the exercise
add_executable(exercisefractures_solution EXCLUDE_FROM_ALL main.cc)

dune_add_test(NAME exercisefractures_solution_a
              CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
              TARGET exercisefractures_solution
              COMMAND ./exercisefractures_solution
              CMD_ARGS exercise_fractures_solution_a.input)

dune_add_test(NAME exercisefractures_solution_b
              CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
              TARGET exercisefractures_solution
              COMMAND ./exercisefractures_solution
              CMD_ARGS exercise_fractures_solution_b.input)

dune_add_test(NAME exercisefractures_solution_c
              CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
              TARGET exercisefractures_solution
              COMMAND ./exercisefractures_solution
              CMD_ARGS exercise_fractures_solution_c.input)

# add a symlink for each input file
add_input_file_links()
# add a symlink for the grids folder
dune_symlink_to_source_files(FILES grids)

#install sources
install(FILES
main.cc
matrixproblem.hh
fractureproblem.hh
matrixspatialparams.hh
fracturespatialparams.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/exercises/solution/exercise-fractures)
