summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-08-05 15:56:58 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-08-05 15:56:58 (GMT)
commit4d0187a4832a60d56bc077a43855b91b8518271c (patch)
tree8bb44d5e5ee55c9e08101d4f5fec72cfe69d49d9 /examples/CMakeLists.txt
parentec5d13d65ba1e57be1ea372b5cd9baab2f9d068b (diff)
downloadhdf5-4d0187a4832a60d56bc077a43855b91b8518271c.zip
hdf5-4d0187a4832a60d56bc077a43855b91b8518271c.tar.gz
hdf5-4d0187a4832a60d56bc077a43855b91b8518271c.tar.bz2
[svn-r27465] Merge dual-binary CMake changes
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt22
1 files changed, 18 insertions, 4 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 1f33f04..7953161 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -38,18 +38,32 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
- TARGET_NAMING (${example} ${LIB_TYPE})
- TARGET_C_PROPERTIES (${example} ${LIB_TYPE} " " " ")
+ TARGET_NAMING (${example} STATIC)
+ TARGET_C_PROPERTIES (${example} STATIC " " " ")
target_link_libraries (${example} ${HDF5_LIB_TARGET})
set_target_properties (${example} PROPERTIES FOLDER examples)
+ if (BUILD_SHARED_LIBS)
+ add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
+ TARGET_NAMING (${example}-shared SHARED)
+ TARGET_C_PROPERTIES (${example}-shared SHARED " " " ")
+ target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET})
+ set_target_properties (${example}-shared PROPERTIES FOLDER examples)
+ endif (BUILD_SHARED_LIBS)
endforeach (example ${examples})
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- TARGET_NAMING (ph5example ${LIB_TYPE})
- TARGET_C_PROPERTIES (ph5example ${LIB_TYPE} " " " ")
+ TARGET_NAMING (ph5example STATIC)
+ TARGET_C_PROPERTIES (ph5example STATIC " " " ")
target_link_libraries (ph5example ${HDF5_LIB_TARGET})
set_target_properties (ph5example PROPERTIES FOLDER examples)
+ if (BUILD_SHARED_LIBS)
+ add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
+ TARGET_NAMING (ph5example-shared SHARED)
+ TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
+ target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET})
+ set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
+ endif (BUILD_SHARED_LIBS)
endif (H5_HAVE_PARALLEL)
if (BUILD_TESTING)