# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.


project( Snap_rounding_2_Tests )

cmake_minimum_required(VERSION 2.8.10)

find_package(CGAL QUIET)

if ( CGAL_FOUND )

  include( ${CGAL_USE_FILE} )

  include( CGAL_CreateSingleSourceCGALProgram )

  include_directories (BEFORE "../../include")

  create_single_source_cgal_program( test_snap_rounding_2.cpp NO_TESTING)

  function(add_Snap_rounding_tests name)
    set(data_dir "data")
    file(GLOB files  RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${data_dir} "${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}/data*")
    foreach(file ${files})
      string(MAKE_C_IDENTIFIER "${name}  ${data_dir}/${file}" test_name)
      cgal_add_test(${name} TEST_NAME ${test_name} ARGUMENTS ${data_dir}/${file} ${data_dir}/output_${file})
      add_test(NAME "${test_name}_compare_results"
        COMMAND ${CMAKE_COMMAND} -E compare_files ${data_dir}/output_${file} ${data_dir}/gold_${file})
      cgal_setup_test_properties("${test_name}_compare_results")
      set_property(TEST "${test_name}_compare_results"
        APPEND PROPERTY DEPENDS "${test_name}")
      if(POLICY CMP0066) # CMake 3.7 or later
        set_property(TEST "${test_name}"
          PROPERTY FIXTURES_SETUP "${test_name}_compare_results")
        set_property(TEST "${test_name}_compare_results"
          APPEND PROPERTY FIXTURES_REQUIRED "${test_name}_compare_results")
      endif()
    endforeach()
  endfunction(add_Snap_rounding_tests)

  if(BUILD_TESTING)
    cgal_add_compilation_test( test_snap_rounding_2 )
    add_Snap_rounding_tests( test_snap_rounding_2 )
  endif()
else()
  
    message(STATUS "This program requires the CGAL library, and will not be compiled.")
  
endif()

