summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-04-24 15:25:13 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-04-24 15:25:13 (GMT)
commitb3c5284692093953132c6c8227e0980b670bf4ad (patch)
tree84cc1f217108c4585586ffd6e74782cbe91734ed /examples/CMakeLists.txt
parentfa829e322ed44a67e2b3f2d6adf1306ad794859b (diff)
parentf435ed67fa53ca35462a60f4025464465d7dc9d0 (diff)
downloadhdf5-b3c5284692093953132c6c8227e0980b670bf4ad.zip
hdf5-b3c5284692093953132c6c8227e0980b670bf4ad.tar.gz
hdf5-b3c5284692093953132c6c8227e0980b670bf4ad.tar.bz2
Merge pull request #1038 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'f435ed67fa53ca35462a60f4025464465d7dc9d0': TRILABS-20 set a compiler name on all project commands TRILABS-19 All c code INCLUDE_DIRECTORIES converted TRILABS-19 Initial conversion of include_directories to targets
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 4da8405..05646d8 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.10)
-PROJECT (HDF5_EXAMPLES)
+project (HDF5_EXAMPLES C)
#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
@@ -46,11 +46,13 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
+ set_property(TARGET ${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
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)
+ set_property(TARGET ${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
TARGET_C_PROPERTIES (${example}-shared SHARED " " " ")
target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET})
set_target_properties (${example}-shared PROPERTIES FOLDER examples)
@@ -59,11 +61,13 @@ endforeach ()
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
+ set_property(TARGET ph5example APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
TARGET_C_PROPERTIES (ph5example STATIC " " " ")
target_link_libraries (ph5example ${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)
+ set_property(TARGET ph5example-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
set_target_properties (ph5example-shared PROPERTIES FOLDER examples)