summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake
blob: dbc1555187f180f3dc1072ad67708ef8742d5583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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/dummy.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]])
check("CMakeFiles/dummy2.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]])

check("CMakeFiles/dummy3.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]])
check("CMakeFiles/dummy4.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]])