summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/GNUMakeJobServerAware-check.cmake
blob: 55a9f0d80c0e5a4944fb1f37ce676c1e6192059e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
set(BUILD_DIR "${RunCMake_BINARY_DIR}/GNUMakeJobServerAware-build")

function(check target regex)
  file(STRINGS ${BUILD_DIR}/${target} lines
    REGEX ${regex}
  )

  list(LENGTH lines len)
  if(len EQUAL 0)
    message(FATAL_ERROR "Could not find matching lines '${regex}' in ${BUILD_DIR}/${target}")
  endif()
endfunction()

check("/CMakeFiles/Foo.dir/build.make" [[\+cd (/d )?"?.*"? && "?.*"? --build "?.*"?]])
check("/CMakeFiles/Foo.dir/build.make" [[\+cd (/d )?"?.*"? && "?.*"? -E touch "?.*"?]])
check("/CMakeFiles/Foo.dir/build.make" [[\+"?.*"? -E true]])