summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-06-25 17:39:35 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-06-25 17:39:35 (GMT)
commit35c9af8371c4da7f5327c76ddab097b442128f59 (patch)
treed51be51c385a9b463388ba154efc3fa37cad49e8 /examples/CMakeLists.txt
parentc752332bfd0e9c3090f3a0c02d0253cd45c2e2ce (diff)
parent1d8f7bf297100ec11204442708a7f670a89f3f02 (diff)
downloadhdf5-inactive/parallel_vds_develop.zip
hdf5-inactive/parallel_vds_develop.tar.gz
hdf5-inactive/parallel_vds_develop.tar.bz2
Merge branch 'develop' into parallel_vds_developinactive/parallel_vds_develop
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt36
1 files changed, 16 insertions, 20 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 2239d64..6e1f79d 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -41,32 +41,28 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
- target_include_directories(${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${example} STATIC)
- target_link_libraries (${example} PRIVATE ${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_include_directories(${example}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${example}-shared SHARED)
- target_link_libraries (${example}-shared PRIVATE ${HDF5_LIBSH_TARGET})
- set_target_properties (${example}-shared PROPERTIES FOLDER examples)
+ target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${example} STATIC)
+ target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${example} SHARED)
+ target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET})
endif ()
+ set_target_properties (${example} PROPERTIES FOLDER examples)
endforeach ()
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- target_include_directories(ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ph5example STATIC)
- target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
- set_target_properties (ph5example PROPERTIES FOLDER examples)
- if (BUILD_SHARED_LIBS)
- add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- target_include_directories(ph5example-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ph5example-shared SHARED)
- target_link_libraries (ph5example-shared PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
- set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
+ target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ph5example STATIC)
+ target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
+ else ()
+ TARGET_C_PROPERTIES (ph5example SHARED)
+ target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
endif ()
+ set_target_properties (ph5example PROPERTIES FOLDER examples)
endif ()
if (BUILD_TESTING)