LOCK-error-timeout.cmake 461 B

1234567891011121314151617
  1. set(script "${CMAKE_CURRENT_LIST_DIR}/timeout-script.cmake")
  2. set(file_to_lock "${CMAKE_CURRENT_BINARY_DIR}/file-to-lock")
  3. file(LOCK "${file_to_lock}")
  4. execute_process(
  5. COMMAND "${CMAKE_COMMAND}" "-Dfile_to_lock=${file_to_lock}" -P "${script}"
  6. RESULT_VARIABLE result
  7. OUTPUT_VARIABLE output
  8. ERROR_VARIABLE error
  9. )
  10. message("Output: ${output}")
  11. message("Error: ${error}")
  12. if(NOT result EQUAL 0)
  13. message(FATAL_ERROR "Result: ${result}")
  14. endif()