summaryrefslogtreecommitdiffstats
path: root/fortran/test/CMakeLists.txt
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-13 19:37:28 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-13 19:37:28 (GMT)
commit838755cf71e270e2123b540bae3a89f6bbffbc2b (patch)
tree38debfdcb9b1481a4a692c56055067db58611783 /fortran/test/CMakeLists.txt
parentc90d6ad2869a9787e5068ca2a9f72f51d5b30438 (diff)
downloadhdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.zip
hdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.tar.gz
hdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.tar.bz2
[svn-r27375] Moved generating Fortran 'test' code from the fortran src directory to the fortran 'test' directory. Updated autotools and cmake.
Diffstat (limited to 'fortran/test/CMakeLists.txt')
-rw-r--r--fortran/test/CMakeLists.txt38
1 files changed, 36 insertions, 2 deletions
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 9b82765..32b3a09 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -23,8 +23,8 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
-set_source_files_properties (tf.F90 tf_gen.F90 PROPERTIES LANGUAGE Fortran)
-add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.F90 tf_gen.F90)
+set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES LANGUAGE Fortran)
+add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90)
set (SHARED_LINK_FLAGS " ")
if (WIN32)
@@ -51,6 +51,40 @@ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
)
#-----------------------------------------------------------------------------
+# Setup the Fortran auto-detection utilities
+# H5_test_buildiface.F90 used to generate various KIND test interfaces
+#-----------------------------------------------------------------------------
+
+add_executable (H5_test_buildiface
+ ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90
+ )
+
+if (WIN32 AND MSVC)
+ if (BUILD_SHARED_LIBS)
+ set_target_properties (H5_test_buildiface
+ PROPERTIES
+ COMPILE_FLAGS "/MT"
+ )
+ endif (BUILD_SHARED_LIBS)
+ set_target_properties (H5_test_buildiface
+ PROPERTIES
+ LINK_FLAGS "/SUBSYSTEM:CONSOLE"
+ )
+endif (WIN32 AND MSVC)
+set_target_properties (H5_test_buildiface PROPERTIES
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
+)
+
+set (CMD $<TARGET_FILE:H5_test_buildiface>)
+add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ DEPENDS H5_test_buildiface
+)
+
+#-----------------------------------------------------------------------------
# Add Tests
#-----------------------------------------------------------------------------