From 184d73d465ba735bb1323deeab9913bd47e7de72 Mon Sep 17 00:00:00 2001 From: Pengfei Date: Thu, 1 Jul 2021 15:46:10 +0800 Subject: [PATCH] Fix LGTM.com not being able to analyse --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6434308..9a21a4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,11 @@ # CMake 3.12.4 required for 20 to be a valid value for CXX_STANDARD -cmake_minimum_required(VERSION 3.15) -# Add MSVC runtime library selection flags automatically: -cmake_policy(SET CMP0091 OLD) -# Don't override the warning flags in MSVC: -cmake_policy(SET CMP0092 NEW) +cmake_minimum_required(VERSION 3.12.4) +if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15) + # Add MSVC runtime library selection flags automatically: + cmake_policy(SET CMP0091 OLD) + # Don't override the warning flags in MSVC: + cmake_policy(SET CMP0092 NEW) +endif () list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") include(DownloadExternals) include(CMakeDependentOption)