aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-09 12:32:48 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-10 15:49:44 +0900
commit6c4e78e8a55eab681393faff888448c887bb7127 (patch)
tree75e1299241ef343d216fa07b46b047e8113f2191 /CMakeLists.txt
parent31e28e2a99e6815da407d201e7287423a4956138 (diff)
downloadlibquotient-6c4e78e8a55eab681393faff888448c887bb7127.tar.gz
libquotient-6c4e78e8a55eab681393faff888448c887bb7127.zip
CMakeLists.txt: fix things around clang-format, inherit CLANG_FORMAT_ARGS
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13f6fcfb..a40d4385 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,7 +97,7 @@ if (ABS_API_DEF_PATH AND ABS_GTAD_PATH)
if (ABS_CLANG_FORMAT)
message( STATUS "clang-format is at ${ABS_CLANG_FORMAT}")
else ()
- message( STATUS "${CLANG_FORMAT} is NOT FOUND; --target update-format-api disabled")
+ message( STATUS "${CLANG_FORMAT} is NOT FOUND; API files won't be reformatted")
endif ()
endif ()
find_package(Git)
@@ -192,18 +192,19 @@ if (MATRIX_DOC_PATH AND GTAD_PATH)
${API_DEFS}
VERBATIM
)
- if (CLANG_FORMAT)
+ if (ABS_CLANG_FORMAT)
# TODO: list(TRANSFORM) is available from CMake 3.12
foreach (S ${api_SRCS})
string (REGEX REPLACE ".cpp$" ".h" H ${S})
list(APPEND api_HDRS ${H})
endforeach()
- set(CLANG_FORMAT_ARGS -i -sort-includes -verbose)
+ set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS})
add_custom_command(TARGET update-api POST_BUILD
COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS}
COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM
+ COMMENT Formatting files
)
endif()
endif()