summaryrefslogtreecommitdiffstats
path: root/fortran/src/CMakeLists.txt
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-21 18:44:52 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-21 18:44:52 (GMT)
commite796ff45c7a858fdd74a8476e41948754332ecd1 (patch)
tree9e7addce19ad1b3b61fac6487cca86fe88db3fb1 /fortran/src/CMakeLists.txt
parent0040ee0c994efcbf192552fee2412821a917e178 (diff)
downloadhdf5-e796ff45c7a858fdd74a8476e41948754332ecd1.zip
hdf5-e796ff45c7a858fdd74a8476e41948754332ecd1.tar.gz
hdf5-e796ff45c7a858fdd74a8476e41948754332ecd1.tar.bz2
[svn-r27421] changed from add_custom_command to add_custom_target for generated files, OBJECT_DEPENDS is not fully functional on Windows (cmake 3.1).
Diffstat (limited to 'fortran/src/CMakeLists.txt')
-rw-r--r--fortran/src/CMakeLists.txt31
1 files changed, 21 insertions, 10 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 773f6ec..0dae501 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -62,13 +62,13 @@ set_target_properties (H5_buildiface PROPERTIES
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
-set (CMD $<TARGET_FILE:H5_buildiface>)
-add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
- COMMAND ${CMD}
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
- DEPENDS H5_buildiface
-)
+#set (CMD $<TARGET_FILE:H5_buildiface>)
+#add_custom_command (
+# OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+# COMMAND ${CMD}
+# WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+# DEPENDS H5_buildiface
+#)
INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY})
#-----------------------------------------------------------------------------
@@ -162,10 +162,21 @@ set (f90_F_SRCS
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
)
-set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90
- PROPERTIES OBJECT_DEPENDS "${f90_F_BASE_SRCS}"
+set (CMD $<TARGET_FILE:H5_buildiface>)
+add_custom_target (H5gen ALL
+ COMMAND ${CMD}
+#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ DEPENDS ${f90_F_BASE_SRCS}
)
+
+set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran)
+
+# Not implemented in cmake VS >=10
+#set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90
+# PROPERTIES OBJECT_DEPENDS "${f90_F_BASE_SRCS}"
+#)
+
set_source_files_properties(
${HDF5_F90_BINARY_DIR}/HDF5.F90
PROPERTIES OBJECT_DEPENDS "${f90_F_BASE_SRCS} ${HDF5_F90_BINARY_DIR}/H5_gen.F90"