diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-05-22 15:23:16 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-05-22 15:23:16 (GMT) |
commit | e96ef71034fbeadcf2ed244b15a14b7151529d29 (patch) | |
tree | 0b07ebf5d12fc46ebfb5ae353a3d0ebad5033a85 /c++/examples | |
parent | e1e63edd359e3753c374440bdb295010c348e9bc (diff) | |
download | hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.zip hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.gz hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.bz2 |
HDFFV-9739 and cmake improvements merge from develop
Diffstat (limited to 'c++/examples')
-rw-r--r-- | c++/examples/CMakeLists.txt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 22ecb19..d3a18f2 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_EXAMPLES) +project (HDF5_CPP_EXAMPLES CXX) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -34,15 +34,17 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") - target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") - target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) endforeach () |