diff options
Diffstat (limited to 'hl/tools/h5watch/CMakeLists.txt')
-rw-r--r-- | hl/tools/h5watch/CMakeLists.txt | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 890ac37..7b00431 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -9,34 +9,24 @@ set (H5WATCH_SOURCES ) #-- Add h5watch program -if (BUILD_STATIC_LIBS) - add_executable (h5watch ${H5WATCH_SOURCES}) - target_compile_options(h5watch PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_ROOT_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +add_executable (h5watch ${H5WATCH_SOURCES}) +target_compile_options(h5watch PRIVATE "${HDF5_CMAKE_C_FLAGS}") +target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_ROOT_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (HDF5_BUILD_STATIC_TOOLS) TARGET_C_PROPERTIES (h5watch STATIC) target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5watch PROPERTIES FOLDER tools/hl) - set (H5_DEP_EXECUTABLES h5watch) -endif () -if (BUILD_SHARED_LIBS) - add_executable (h5watch-shared ${H5WATCH_SOURCES}) - target_compile_options(h5watch-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h5watch-shared PRIVATE "${HDF5_TOOLS_ROOT_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (h5watch-shared SHARED) - target_link_libraries (h5watch-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) - set_target_properties (h5watch-shared PROPERTIES FOLDER tools/hl) - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared) +else () + TARGET_C_PROPERTIES (h5watch SHARED) + target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) endif () +set_target_properties (h5watch PROPERTIES FOLDER tools/hl) +set (H5_DEP_EXECUTABLES h5watch) #----------------------------------------------------------------------------- # Add Target to clang-format #----------------------------------------------------------------------------- if (HDF5_ENABLE_FORMATTERS) - if (BUILD_STATIC_LIBS) - clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch) - else () - clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch-shared) - endif () + clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch) endif () if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) @@ -47,7 +37,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) add_executable (extend_dset ${extend_dset_SOURCES}) target_compile_options(extend_dset PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - if (BUILD_STATIC_LIBS) + if (HDF5_BUILD_STATIC_TOOLS) TARGET_C_PROPERTIES (extend_dset STATIC) target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) else () @@ -66,7 +56,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) target_compile_options(h5watchgentest PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - if (BUILD_STATIC_LIBS) + if (HDF5_BUILD_STATIC_TOOLS) TARGET_C_PROPERTIES (h5watchgentest STATIC) target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) else () |