summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-04 21:36:52 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-04 21:36:52 (GMT)
commit30c7264c2ca0f169b099b6ebbf13c5bd71652ebc (patch)
tree1a92edfa20e5e6dfe467b002227220c7f9d61cfd /c++
parent6b71d6dc9453e8f94ac82732496ee59ca6495587 (diff)
downloadhdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.zip
hdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.tar.gz
hdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.tar.bz2
CMake and script changes for clang-format
Diffstat (limited to 'c++')
-rw-r--r--c++/examples/CMakeLists.txt14
-rw-r--r--c++/src/CMakeLists.txt11
-rw-r--r--c++/test/CMakeLists.txt9
3 files changed, 33 insertions, 1 deletions
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index 890d22d..b56014f 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -48,6 +48,13 @@ foreach (example ${examples})
endif ()
endif ()
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example})
+ endif ()
endforeach ()
foreach (example ${tutr_examples})
@@ -66,6 +73,13 @@ foreach (example ${tutr_examples})
endif ()
endif ()
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example})
+ endif ()
endforeach ()
if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 058f457..0b4473f 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -129,6 +129,17 @@ if (BUILD_SHARED_LIBS)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIB_TARGET})
+ else ()
+ clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIBSH_TARGET})
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
install (
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index ca2295e..b911424 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -37,7 +37,7 @@ set (CPP_TEST_SOURCES
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
-add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} )
+add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.h)
target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(cpp_testhdf5
@@ -57,6 +57,13 @@ else ()
endif ()
set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_CPP_TEST_cpp_testhdf5_FORMAT cpp_testhdf5)
+endif ()
+
if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
endif ()