From 4282b34ef80041e4f40923ae652cc2e30a6d40e6 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 7 Sep 2021 08:52:53 +0200 Subject: KDEClangFormat: Check for autogeneration notice instead of copyright text If people ship their own clang-format file they might still have the copyright, because they forked it. Instead search for the notice that the file is autogenerated. --- kde-modules/KDEClangFormat.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kde-modules/KDEClangFormat.cmake b/kde-modules/KDEClangFormat.cmake index 9fd467e8..5adba5e9 100644 --- a/kde-modules/KDEClangFormat.cmake +++ b/kde-modules/KDEClangFormat.cmake @@ -56,8 +56,8 @@ find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format) if(KDE_CLANG_FORMAT_EXECUTABLE) set(CLANG_FORMAT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format) if (EXISTS ${CLANG_FORMAT_FILE}) - file(READ ${CLANG_FORMAT_FILE} CLANG_FORMAT_CONTENTS LIMIT 128) - string(FIND "${CLANG_FORMAT_CONTENTS}" "SPDX-FileCopyrightText: 2019 Christoph Cullmann" matchres) + file(READ ${CLANG_FORMAT_FILE} CLANG_FORMAT_CONTENTS LIMIT 1000) + string(FIND "${CLANG_FORMAT_CONTENTS}" "This file got automatically created by ECM, do not edit" matchres) if(${matchres} EQUAL -1) message(WARNING "The .clang-format file already exists. Please remove it in order to use the file provided by ECM") else() -- cgit v1.2.1