diff options
author | Brad King <brad.king@kitware.com> | 2017-09-27 11:15:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-27 11:16:06 (GMT) |
commit | f9c619105ca6f3358a9763c4446820fcf43ad867 (patch) | |
tree | c9035d58309d3e7f33ec7c560221252a7a7c41d9 | |
parent | 05e234cb1611aa7a7fe8e126468515c666eeeece (diff) | |
parent | 1a7b8c83210c2574652c5045e3338a7ccba03734 (diff) | |
download | CMake-f9c619105ca6f3358a9763c4446820fcf43ad867.zip CMake-f9c619105ca6f3358a9763c4446820fcf43ad867.tar.gz CMake-f9c619105ca6f3358a9763c4446820fcf43ad867.tar.bz2 |
Merge topic 'GetPrerequisites-no-clear-on-missing'
1a7b8c83 GetPrerequisites: Restore behavior on missing binary of not clearing list
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1312
-rw-r--r-- | Modules/GetPrerequisites.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/TargetMissing-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/TargetMissing.cmake | 4 |
5 files changed, 11 insertions, 1 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 4e52cb3..b81dd76 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -659,7 +659,6 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if(NOT EXISTS "${target}") message("warning: target '${target}' does not exist...") - set(${prerequisites_var} "" PARENT_SCOPE) return() endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index aa4c5ac..5622f8e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -147,6 +147,7 @@ endif() add_RunCMake_test(GeneratorExpression) add_RunCMake_test(GeneratorPlatform) add_RunCMake_test(GeneratorToolset) +add_RunCMake_test(GetPrerequisites) add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test add_RunCMake_test(TargetPropertyGeneratorExpressions) diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake new file mode 100644 index 0000000..3856c54 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake) diff --git a/Tests/RunCMake/GetPrerequisites/TargetMissing-stderr.txt b/Tests/RunCMake/GetPrerequisites/TargetMissing-stderr.txt new file mode 100644 index 0000000..cffe5f8 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/TargetMissing-stderr.txt @@ -0,0 +1,3 @@ +^warning: target 'does_not_exist' is not absolute\.\.\. +warning: target 'does_not_exist' does not exist\.\.\. +result_var='value;before;call'$ diff --git a/Tests/RunCMake/GetPrerequisites/TargetMissing.cmake b/Tests/RunCMake/GetPrerequisites/TargetMissing.cmake new file mode 100644 index 0000000..84fd32c --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/TargetMissing.cmake @@ -0,0 +1,4 @@ +include(GetPrerequisites) +set(result_var value before call) +get_prerequisites(does_not_exist result_var 0 0 "" "") +message("result_var='${result_var}'") |