From 28f541cd3c55a4b152b7ed15922be13c79714572 Mon Sep 17 00:00:00 2001 From: gmh5225 <2315157@qq.com> Date: Fri, 7 Oct 2022 06:41:11 +0800 Subject: [PATCH] [feature] add CMP0091 --- src/cmake_generator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmake_generator.cpp b/src/cmake_generator.cpp index 94a8557..6d97dec 100644 --- a/src/cmake_generator.cpp +++ b/src/cmake_generator.cpp @@ -523,7 +523,11 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { if (root_project) { cmd("cmake_minimum_required")("VERSION", project.cmake_version).endl(); - + // clang-format off + cmd("if")("POLICY", "CMP0091"); + cmd("cmake_policy")("SET", "CMP0091", "NEW"); + cmd("endif")().endl(); + // clang-format on if (!project.allow_in_tree) { // clang-format off cmd("if")("CMAKE_SOURCE_DIR", "STREQUAL", "CMAKE_BINARY_DIR");