cmake/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake

19 lines
670 B
CMake
Raw Normal View History

2023-12-07 09:12:54 +01:00
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]])