summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/CMakeLists.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 8e2d685..95ca9b1 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -38,16 +38,17 @@ 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} )
-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_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_definitions(cpp_testhdf5
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
)
-TARGET_C_PROPERTIES (cpp_testhdf5 STATIC)
-target_link_libraries (cpp_testhdf5 PRIVATE
- ${HDF5_CPP_LIB_TARGET}
- ${HDF5_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
-)
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cpp_testhdf5 STATIC)
+ target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (cpp_testhdf5 SHARED)
+ target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
include (CMakeTests.cmake)