build: add new target to check the CMake format

This commit is contained in:
Gabriel Ferreira
2023-10-27 17:06:18 -03:00
parent 302abf5a95
commit a2250f02ce
2 changed files with 12 additions and 0 deletions

View File

@@ -306,6 +306,17 @@ macro(process_options)
${PROJECT_SOURCE_DIR}/build-support/cmake-format-modules.yaml -i
${MODULES_CMAKE_FILES}
)
add_custom_target(
cmake-format-check
COMMAND
${CMAKE_FORMAT_PROGRAM} -c
${PROJECT_SOURCE_DIR}/build-support/cmake-format.yaml --check
${INTERNAL_CMAKE_FILES}
COMMAND
${CMAKE_FORMAT_PROGRAM} -c
${PROJECT_SOURCE_DIR}/build-support/cmake-format-modules.yaml --check
${MODULES_CMAKE_FILES}
)
unset(MODULES_CMAKE_FILES)
unset(INTERNAL_CMAKE_FILES)
endif()

1
ns3
View File

@@ -1060,6 +1060,7 @@ def build_step(args,
non_executable_targets = ["assemble-introspected-command-line",
"check-version",
"cmake-format",
"cmake-format-check",
"coverage_gcc",
"docs",
"doxygen",