summaryrefslogtreecommitdiffstats
path: root/config/sanitizer/formatting.cmake
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-11-29 13:46:34 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-11-29 13:46:34 (GMT)
commit49b99cf1b058eec8f23ce78b85f68a8305e9785e (patch)
tree3b92096dbcd5479bb2ded1804ad5e1755d7a8e73 /config/sanitizer/formatting.cmake
parent9572872ad7a4c06f362fd37f26c35890238caed2 (diff)
parent4fea1bcccd283a407fe0936c56e56cc40a019b3c (diff)
downloadhdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.zip
hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.gz
hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.bz2
Merge branch 'develop' into zzz-gitlab-ci
Diffstat (limited to 'config/sanitizer/formatting.cmake')
-rw-r--r--config/sanitizer/formatting.cmake52
1 files changed, 0 insertions, 52 deletions
diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake
index 677a69a..5aaa2a6 100644
--- a/config/sanitizer/formatting.cmake
+++ b/config/sanitizer/formatting.cmake
@@ -90,55 +90,3 @@ function(clang_format TARGET_NAME)
endif()
endfunction()
-#
-# cmake-format
-#
-find_program(CMAKE_FORMAT_EXE "cmake-format")
-mark_as_advanced(FORCE CMAKE_FORMAT_EXE)
-if(CMAKE_FORMAT_EXE)
- message(STATUS "cmake-format found: ${CMAKE_FORMAT_EXE}")
-else()
- message(STATUS "cmake-format not found!")
-endif()
-
-# When called, this function will call 'cmake-format' program on all listed
-# files (if both the program and the files exist and are found)
-# ~~~
-# Required:
-# TARGET_NAME - The name of the target to create.
-#
-# Optional:
-# ARGN - Any arguments passed in will be considered as 'files' to perform the
-# formatting on. Any items that are not files will be ignored. Both relative and
-# absolute paths are accepted.
-# ~~~
-function(cmake_format TARGET_NAME)
- if(CMAKE_FORMAT_EXE)
- set(FORMAT_FILES)
- # Determine files that exist
- foreach(iter IN LISTS ARGN)
- if(EXISTS ${iter})
- set(FORMAT_FILES ${FORMAT_FILES} ${iter})
- elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${iter})
- set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${iter})
- endif()
- endforeach()
-
- # Generate target
- if(FORMAT_FILES)
- if(TARGET ${TARGET_NAME})
- message(
- ERROR
- "Cannot create cmake-format target '${TARGET_NAME}', already exists.")
- else()
- add_custom_target(${TARGET_NAME} COMMAND ${CMAKE_FORMAT_EXE} -i
- ${FORMAT_FILES})
-
- if(NOT TARGET cmake-format)
- add_custom_target(cmake-format)
- endif()
- add_dependencies(cmake-format ${TARGET_NAME})
- endif()
- endif()
- endif()
-endfunction()