Files
CMake/Tests/RunCMake/Make/RunCMakeTest.cmake
Brad King 2d64f9f08d include_regular_expression: Fix propagation to subdirectories
Refactoring in commit v3.4.0-rc1~321^2 (cmMakefile: Remove special
handling of INCLUDE_REGULAR_EXPRESSION, 2015-04-04) accidentally broke
propagation of the include regex to subdirectories.  Refactoring in
commit v3.5.0-rc1~319^2~1 (cmState: Initialize properties immediately,
2015-10-07) moved maintenance of this value from `cmMakefile` to
`cmStateSnapshot`.

Restore propagation of the `INCLUDE_REGULAR_EXPRESSION` to
subdirectories and add a test to cover it.

Fixes: #17676
2018-01-24 08:20:19 -05:00

21 lines
669 B
CMake

include(RunCMake)
function(run_TargetMessages case)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TargetMessages-${case}-build)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
set(RunCMake_TEST_OPTIONS "${ARGN}")
run_cmake(TargetMessages-${case})
run_cmake_command(TargetMessages-${case}-build ${CMAKE_COMMAND} --build .)
endfunction()
run_TargetMessages(ON)
run_TargetMessages(OFF)
run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON)
run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF)
run_cmake(CustomCommandDepfile-ERROR)
run_cmake(IncludeRegexSubdir)