diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 02:07:31 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 02:07:31 (GMT) |
commit | 94ecd14100c226ae16ba8e6122e8a025b408f360 (patch) | |
tree | ead9be12c20e05113ec060ddfc81bac74c8162e9 /examples | |
parent | ce39d7501c58427add05aba62956acb84a6f56da (diff) | |
download | hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.zip hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.tar.gz hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.tar.bz2 |
Brings many CMake changes from develop
Diffstat (limited to 'examples')
-rw-r--r-- | examples/CMakeLists.txt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 527b11f..9ab870f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,7 +44,7 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${example} STATIC) target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET}) @@ -53,11 +53,18 @@ foreach (example ${examples}) target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (${example} PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_${example}_FORMAT ${example}) + endif () endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ph5example STATIC) target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) @@ -66,6 +73,13 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) endif () set_target_properties (ph5example PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_ph5example_FORMAT ph5example) + endif () endif () if (BUILD_TESTING AND HDF5_TEST_EXAMPLES) |