GNUMakeJobServerAware-check.cmake 933 B

1234567891011121314151617181920212223242526
  1. set(BUILD_DIR "${RunCMake_BINARY_DIR}/GNUMakeJobServerAware-build")
  2. function(check target line)
  3. # Read the file and split it into a list of lines
  4. file(READ ${BUILD_DIR}/${target} contents)
  5. STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}")
  6. STRING(REGEX REPLACE "\n" ";" contents "${contents}")
  7. set(found FALSE)
  8. foreach(entry ${contents})
  9. if("${entry}" MATCHES "${line}")
  10. set(found TRUE)
  11. break()
  12. endif()
  13. endforeach()
  14. if(NOT found)
  15. message(FATAL_ERROR "Could not find '${line}' in ${BUILD_DIR}/${target}\n${contents}")
  16. endif()
  17. endfunction()
  18. check("CMakeFiles/dummy.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]])
  19. check("CMakeFiles/dummy2.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]])
  20. check("CMakeFiles/dummy3.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]])
  21. check("CMakeFiles/dummy4.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]])