diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-06-20 11:55:05 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-06-20 11:55:05 (GMT) |
commit | 7ee92d580510a7d90db7f3be8d2061c9c8f09a1b (patch) | |
tree | e810e42048e557b954b713185c40793938f8d375 /test/CMakeLists.txt | |
parent | c2a744995125e308f1a37d6daaa9749126cf9f60 (diff) | |
download | hdf5-7ee92d580510a7d90db7f3be8d2061c9c8f09a1b.zip hdf5-7ee92d580510a7d90db7f3be8d2061c9c8f09a1b.tar.gz hdf5-7ee92d580510a7d90db7f3be8d2061c9c8f09a1b.tar.bz2 |
HDFFV-10805 Merge SHARED ONLY option from develop
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 214 |
1 files changed, 101 insertions, 113 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 42fc3a6..5b34ec5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,29 +23,32 @@ set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/swmr_common.h ) -add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) -target_include_directories(${HDF5_TEST_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" - INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" -) -TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) -target_link_libraries (${HDF5_TEST_LIB_TARGET} - PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} - PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib> -) -if (MINGW) - target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") +if (NOT ONLY_SHARED_LIBS) + add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) + target_include_directories (${HDF5_TEST_LIB_TARGET} + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + ) + TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) + target_link_libraries (${HDF5_TEST_LIB_TARGET} + PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} + PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib> + ) + if (MINGW) + target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") + endif () + H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0) + set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) endif () -H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0) if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) - target_include_directories(${HDF5_TEST_LIBSH_TARGET} + target_include_directories (${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE> + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" ) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} @@ -85,9 +88,9 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) - target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED) - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) @@ -110,9 +113,9 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) - target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED) - target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) @@ -241,17 +244,15 @@ set (H5_TESTS macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - target_include_directories(${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${file} STATIC) - target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) - set_target_properties (${file} PROPERTIES FOLDER test) - if (BUILD_SHARED_LIBS) - add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) - target_include_directories(${file}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (${file}-shared SHARED) - target_link_libraries (${file}-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (${file}-shared PROPERTIES FOLDER test) + target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (${file} STATIC) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (${file} SHARED) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () + set_target_properties (${file} PROPERTIES FOLDER test) endmacro () set (H5_TESTS_MULTIPLE @@ -273,61 +274,58 @@ endforeach () ######### Also special handling of link libs ############# #-- Adding test for direct_chunk add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) -target_include_directories(direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (direct_chunk STATIC) -target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) -set_target_properties (direct_chunk PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (direct_chunk-shared ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) - target_include_directories(direct_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (direct_chunk-shared SHARED) - target_link_libraries (direct_chunk-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS}) - set_target_properties (direct_chunk-shared PROPERTIES FOLDER test) +target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (direct_chunk STATIC) + target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) +else () + TARGET_C_PROPERTIES (direct_chunk SHARED) + target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS}) endif () +set_target_properties (direct_chunk PROPERTIES FOLDER test) ######### Special handling for multiple sources ############# #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) -target_include_directories(testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (testhdf5 STATIC) -target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET}) -set_target_properties (testhdf5 PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (testhdf5-shared ${testhdf5_SOURCES}) - target_include_directories(testhdf5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (testhdf5-shared SHARED) - target_link_libraries (testhdf5-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET}) - set_target_properties (testhdf5-shared PROPERTIES FOLDER test) +target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (testhdf5 STATIC) + target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (testhdf5 SHARED) + target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () +set_target_properties (testhdf5 PROPERTIES FOLDER test) #-- Adding test for cache_image add_executable (cache_image ${cache_image_SOURCES}) -target_include_directories(cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (cache_image STATIC) -target_link_libraries (cache_image PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (cache_image PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (cache_image-shared ${cache_image_SOURCES}) - target_include_directories(cache_image-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (cache_image-shared SHARED) - target_link_libraries (cache_image-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (cache_image-shared PROPERTIES FOLDER test) +target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (cache_image STATIC) + target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (cache_image SHARED) + target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () +set_target_properties (cache_image PROPERTIES FOLDER test) #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) -target_include_directories(ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (ttsafe STATIC) -target_link_libraries (ttsafe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (ttsafe PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (ttsafe-shared ${ttsafe_SOURCES}) - target_include_directories(ttsafe-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (ttsafe-shared SHARED) - target_link_libraries (ttsafe-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (ttsafe-shared PROPERTIES FOLDER test) +target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (ttsafe STATIC) + target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET}) + if (NOT WIN32) + target_link_libraries (ttsafe + PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads> + ) + endif () +else () + TARGET_C_PROPERTIES (ttsafe SHARED) + target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>) endif () +set_target_properties (ttsafe PROPERTIES FOLDER test) ############################################################################## ### A D D I T I O N A L T E S T S ### @@ -397,31 +395,27 @@ endforeach () # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no <foo>-shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) -target_include_directories(accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (accum_swmr_reader STATIC) -target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (accum_swmr_reader STATIC) + target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (accum_swmr_reader SHARED) + target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) +endif () set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) #-- Set accum dependencies set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) -if (BUILD_SHARED_LIBS) - set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) -endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (filter_plugin SHARED) - target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET}) - set_target_properties (filter_plugin PROPERTIES FOLDER test) -else () - add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (filter_plugin STATIC) - target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) endif () @@ -430,44 +424,38 @@ endif () ############################################################################## set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_chunk ${use_append_chunk_SOURCES}) -target_include_directories(use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (use_append_chunk STATIC) -target_link_libraries (use_append_chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_append_chunk PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) - target_include_directories(use_append_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_chunk-shared SHARED) - target_link_libraries (use_append_chunk-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test) +target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (use_append_chunk STATIC) + target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (use_append_chunk SHARED) + target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () +set_target_properties (use_append_chunk PROPERTIES FOLDER test) set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) -target_include_directories(use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (use_append_mchunks STATIC) -target_link_libraries (use_append_mchunks PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_append_mchunks PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) - target_include_directories(use_append_mchunks-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED) - target_link_libraries (use_append_mchunks-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test) +target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (use_append_mchunks STATIC) + target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (use_append_mchunks SHARED) + target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () +set_target_properties (use_append_mchunks PROPERTIES FOLDER test) set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) -target_include_directories(use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") -TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC) -target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) - target_include_directories(use_disable_mdc_flushes-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED) - target_link_libraries (use_disable_mdc_flushes-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test) +target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC) + target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (use_disable_mdc_flushes SHARED) + target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () +set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) include (CMakeTests.cmake) |