summaryrefslogtreecommitdiffstats
path: root/hl/c++/examples
diff options
context:
space:
mode:
Diffstat (limited to 'hl/c++/examples')
-rw-r--r--hl/c++/examples/CMakeLists.txt23
1 files changed, 16 insertions, 7 deletions
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index 8e64239..50e08e8 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -5,13 +5,22 @@ project (HDF5_HL_CPP_EXAMPLES CXX)
# Add in the examples for the Packet Table codes
# --------------------------------------------------------------------
add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp)
-target_include_directories(ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (ptExampleFL STATIC)
-target_link_libraries (ptExampleFL PRIVATE
- ${HDF5_HL_CPP_LIB_TARGET}
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_LIB_TARGET}
-)
+target_include_directories (ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ptExampleFL STATIC)
+ target_link_libraries (ptExampleFL PRIVATE
+ ${HDF5_HL_CPP_LIB_TARGET}
+ ${HDF5_HL_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ )
+else ()
+ TARGET_C_PROPERTIES (ptExampleFL SHARED)
+ target_link_libraries (ptExampleFL PRIVATE
+ ${HDF5_HL_CPP_LIBSH_TARGET}
+ ${HDF5_HL_LIBSH_TARGET}
+ ${HDF5_LIBSH_TARGET}
+ )
+endif ()
set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
if (BUILD_TESTING)