
cmake_minimum_required(VERSION 3.13)

set(command "/usr/local/Cellar/cmake/3.14.4/bin/cmake;-DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc;-DGMP_LOCATION=/usr/local/lib;-DGMP_INCLUDE=/usr/local/include;-DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++;-DSYLVAN_BUILD_DOCS=OFF;-DSYLVAN_BUILD_EXAMPLES=OFF;-DCMAKE_BUILD_TYPE=Release;-DCMAKE_POSITION_INDEPENDENT_CODE=ON;-DUSE_CARL=ON;-Dcarl_DIR=/Users/jipspel/Documents/Tools/storm/debug-build/resources/3rdparty/carl;-DSYLVAN_PORTABLE=OFF;-DBoost_INCLUDE_DIRS=/usr/local/include;-DBUILD_SHARED_LIBS=OFF;-DSYLVAN_BUILD_TESTS=OFF;-GUnix Makefiles;/Users/jipspel/Documents/Tools/storm/resources/3rdparty/sylvan")
set(log_merged "")
set(log_output_on_failure "")
set(stdout_log "/Users/jipspel/Documents/Tools/storm/test/sylvan/src/sylvan-stamp/sylvan-configure-out.log")
set(stderr_log "/Users/jipspel/Documents/Tools/storm/test/sylvan/src/sylvan-stamp/sylvan-configure-err.log")
execute_process(
  COMMAND ${command}
  RESULT_VARIABLE result
  OUTPUT_FILE "${stdout_log}"
  ERROR_FILE "${stderr_log}"
  )
macro(read_up_to_max_size log_file output_var)
  file(SIZE ${log_file} determined_size)
  set(max_size 10240)
  if (determined_size GREATER max_size)
    math(EXPR seek_position "${determined_size} - ${max_size}")
    file(READ ${log_file} ${output_var} OFFSET ${seek_position})
    set(${output_var} "...skipping to end...\n${${output_var}}")
  else()
    file(READ ${log_file} ${output_var})
  endif()
endmacro()
if(result)
  set(msg "Command failed: ${result}\n")
  foreach(arg IN LISTS command)
    set(msg "${msg} '${arg}'")
  endforeach()
  if (${log_merged})
    set(msg "${msg}\nSee also\n  ${stderr_log}")
  else()
    set(msg "${msg}\nSee also\n  /Users/jipspel/Documents/Tools/storm/test/sylvan/src/sylvan-stamp/sylvan-configure-*.log")
  endif()
  if (${log_output_on_failure})
    message(SEND_ERROR "${msg}")
    if (${log_merged})
      read_up_to_max_size("${stderr_log}" error_log_contents)
      message(STATUS "Log output is:\n${error_log_contents}")
    else()
      read_up_to_max_size("${stdout_log}" out_log_contents)
      read_up_to_max_size("${stderr_log}" err_log_contents)
      message(STATUS "stdout output is:\n${out_log_contents}")
      message(STATUS "stderr output is:\n${err_log_contents}")
    endif()
    message(FATAL_ERROR "Stopping after outputting logs.")
  else()
    message(FATAL_ERROR "${msg}")
  endif()
else()
  set(msg "sylvan configure command succeeded.  See also /Users/jipspel/Documents/Tools/storm/test/sylvan/src/sylvan-stamp/sylvan-configure-*.log")
  message(STATUS "${msg}")
endif()
