mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-03 00:49:20 +08:00
34 lines
1.6 KiB
Diff
34 lines
1.6 KiB
Diff
|
From 0d5ed9bb9117f6526691b3572bf85090efbeed4a Mon Sep 17 00:00:00 2001
|
||
|
From: Alexander Lohnau <alexander.lohnau@gmx.de>
|
||
|
Date: Sat, 30 Jan 2021 13:44:07 +0100
|
||
|
Subject: [PATCH] KDEClangFormat: Do not override custom clang-format files
|
||
|
|
||
|
---
|
||
|
kde-modules/KDEClangFormat.cmake | 13 ++++++++++++-
|
||
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/kde-modules/KDEClangFormat.cmake b/kde-modules/KDEClangFormat.cmake
|
||
|
index 6cdbd2b5..995f03ad 100644
|
||
|
--- a/kde-modules/KDEClangFormat.cmake
|
||
|
+++ b/kde-modules/KDEClangFormat.cmake
|
||
|
@@ -35,7 +35,18 @@ find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
|
||
|
|
||
|
# instantiate our clang-format file, must be in source directory for tooling if we have the tool
|
||
|
if(KDE_CLANG_FORMAT_EXECUTABLE)
|
||
|
- configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format @ONLY)
|
||
|
+ 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)
|
||
|
+ 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()
|
||
|
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CLANG_FORMAT_FILE} @ONLY)
|
||
|
+ endif()
|
||
|
+ else()
|
||
|
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CLANG_FORMAT_FILE} @ONLY)
|
||
|
+ endif()
|
||
|
endif()
|
||
|
|
||
|
# formatting target
|