diff options
author | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-09-07 08:52:53 +0200 |
---|---|---|
committer | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-09-11 18:17:23 +0000 |
commit | 4282b34ef80041e4f40923ae652cc2e30a6d40e6 (patch) | |
tree | 560ca5e78fa9f4cf33da29f633c6f327871d3782 | |
parent | 2bd7db94eee1a81dfcddcb26f48b5af6c09b8d80 (diff) | |
download | extra-cmake-modules-4282b34ef80041e4f40923ae652cc2e30a6d40e6.tar.gz extra-cmake-modules-4282b34ef80041e4f40923ae652cc2e30a6d40e6.tar.bz2 |
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.
-rw-r--r-- | kde-modules/KDEClangFormat.cmake | 4 |
1 files 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() |