diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 17:03:12 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 17:03:12 (GMT) |
commit | 453238e90e1574ef1c15e3c79f7fb3d77920e77c (patch) | |
tree | 6aa9407c7a4cb1bd10975205c14ff8b1ce3f0d5e /c++ | |
parent | 636cba89e605644c8f094fcc7f951c70cd895a39 (diff) | |
parent | ca0c0c3dc83acb7261e607cfee3b3ef04d167188 (diff) | |
download | hdf5-453238e90e1574ef1c15e3c79f7fb3d77920e77c.zip hdf5-453238e90e1574ef1c15e3c79f7fb3d77920e77c.tar.gz hdf5-453238e90e1574ef1c15e3c79f7fb3d77920e77c.tar.bz2 |
Merge pull request #2907 in HDFFV/hdf5 from ~BYRN/hdf5_clang_format:hdf5_1_10 to hdf5_1_10
* commit 'ca0c0c3dc83acb7261e607cfee3b3ef04d167188':
Merge of clang-format changes from develop
Diffstat (limited to 'c++')
-rw-r--r-- | c++/examples/CMakeLists.txt | 14 | ||||
-rw-r--r-- | c++/src/CMakeLists.txt | 11 | ||||
-rw-r--r-- | c++/test/CMakeLists.txt | 9 |
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 () |