From 3365410bde9e63e9f3cded6bc8fc28096b6645da Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 1 Nov 2019 20:58:35 +0800 Subject: [PATCH] cmake: only define test policy on old versions CMP0037 only reserves the test name if CTest is included on newer versions of CMake. This commit fixes a build warning. --- cmake/Tests.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index 6845a1204..cc61bc837 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -99,7 +99,8 @@ ADD_CUSTOM_TARGET(serial_test_high_level # Create the 'test' target. # Set a policy so CMake stops complaining about the name 'test'. CMAKE_POLICY(PUSH) -IF(POLICY CMP0037) + +IF(${CMAKE_VERSION} VERSION_LESS 3.11.0 AND POLICY CMP0037) CMAKE_POLICY(SET CMP0037 OLD) ENDIF() ADD_CUSTOM_TARGET(test)