diff options
author | William Sciaroni <William.Sciaroni@ngc.com> | 2023-11-08 16:05:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-10 18:19:11 (GMT) |
commit | 5e0c1777a3153fd9b3c1f98e1a584a4525da6141 (patch) | |
tree | 1ed15898abd7a04658574ae92108d864f2e887cb /Tests | |
parent | eaa00d4dfa5ea7e611fc447d986bb10c41c7b0e1 (diff) | |
download | CMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.zip CMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.tar.gz CMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.tar.bz2 |
Optionally make `test` target depend on `all`
Fixes: #8774
Diffstat (limited to 'Tests')
4 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake index 9c58bae..6a74f57 100644 --- a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake @@ -15,3 +15,5 @@ function(run_BuiltinTarget case target) endfunction() run_BuiltinTarget(TestDependsAll-Default test) +run_BuiltinTarget(TestDependsAll-No test) +run_BuiltinTarget(TestDependsAll-Yes test) diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake new file mode 100644 index 0000000..50ec3b9 --- /dev/null +++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake @@ -0,0 +1,2 @@ +include(TestDependsAll-common.cmake) +set(CMAKE_SKIP_TEST_ALL_DEPENDENCY ON) diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake new file mode 100644 index 0000000..ed175d4 --- /dev/null +++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt) + set(RunCMake_TEST_FAILED "Building 'test' target did not build 'all' target:\n ${RunCMake_TEST_BINARY_DIR}/custom-output.txt") +endif() diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake new file mode 100644 index 0000000..c35c98d --- /dev/null +++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake @@ -0,0 +1,2 @@ +include(TestDependsAll-common.cmake) +set(CMAKE_SKIP_TEST_ALL_DEPENDENCY OFF) |