diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index d78498213ce..8e6b7646aa6 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -432,9 +432,10 @@ function(PCL_ADD_BENCHMARK _name) #Only applies to MSVC if(MSVC) #Requires CMAKE version 3.13.0 - if(CMAKE_VERSION VERSION_LESS "3.13.0" AND (NOT ArgumentWarningShown)) + get_target_property(BenchmarkArgumentWarningShown run_benchmarks PCL_BENCHMARK_ARGUMENTS_WARNING_SHOWN) + if(CMAKE_VERSION VERSION_LESS "3.13.0" AND (NOT BenchmarkArgumentWarningShown)) message(WARNING "Arguments for benchmark projects are not added - this requires at least CMake 3.13. Can be added manually in \"Project settings -> Debugging -> Command arguments\"") - set (ArgumentWarningShown TRUE PARENT_SCOPE) + set_target_properties(run_benchmarks PROPERTIES PCL_BENCHMARK_ARGUMENTS_WARNING_SHOWN TRUE) else() #Only add if there are arguments to test if(PCL_ADD_BENCHMARK_ARGUMENTS)