2018-03-10 02:31:58 +08:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2018-04-20 23:11:55 +08:00
|
|
|
project (HDF5_FORTRAN_TESTS C Fortran)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2015-09-04 05:45:17 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Setup the Fortran auto-detection utilities
|
|
|
|
# H5_test_buildiface.F90 used to generate various KIND test interfaces
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2018-05-03 04:42:38 +08:00
|
|
|
add_executable (H5_test_buildiface ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90)
|
|
|
|
target_include_directories(H5_test_buildiface
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_BINARY_DIR} ${HDF5_F90_BINARY_DIR}
|
|
|
|
)
|
2018-05-08 06:23:25 +08:00
|
|
|
#if (BUILD_SHARED_LIBS)
|
|
|
|
# target_compile_definitions(H5_test_buildiface
|
|
|
|
# PRIVATE
|
|
|
|
# $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>
|
|
|
|
# )
|
|
|
|
#endif ()
|
|
|
|
if(MSVC)
|
|
|
|
set_property(TARGET H5_test_buildiface PROPERTY COMPILE_FLAGS "/MT")
|
|
|
|
endif()
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET H5_test_buildiface APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-04 04:41:50 +08:00
|
|
|
set_property(TARGET H5_test_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-09-04 05:45:17 +08:00
|
|
|
set_target_properties (H5_test_buildiface PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
|
|
|
|
)
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2018-01-12 00:48:14 +08:00
|
|
|
file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared")
|
2018-01-20 00:49:17 +08:00
|
|
|
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2018-01-12 00:48:14 +08:00
|
|
|
file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static")
|
2018-01-20 00:49:17 +08:00
|
|
|
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
|
2015-09-04 05:45:17 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Add Test Lib
|
|
|
|
#-----------------------------------------------------------------------------
|
2015-08-06 05:01:07 +08:00
|
|
|
add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c)
|
2015-02-21 01:25:56 +08:00
|
|
|
set_source_files_properties (t.c PROPERTIES LANGUAGE C)
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET}
|
2018-06-07 02:44:56 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC)
|
|
|
|
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_F90_C_LIB_TARGET}
|
|
|
|
${HDF5_TEST_LIB_TARGET}
|
|
|
|
)
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC 0)
|
2014-03-26 02:25:53 +08:00
|
|
|
set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
|
|
|
|
FOLDER libraries/test/fortran
|
2015-02-21 01:25:56 +08:00
|
|
|
LINKER_LANGUAGE C
|
2014-03-26 02:25:53 +08:00
|
|
|
)
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-08-06 05:01:07 +08:00
|
|
|
add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c)
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET}
|
2018-06-07 02:44:56 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
target_compile_definitions(${HDF5_F90_C_TEST_LIBSH_TARGET}
|
|
|
|
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
|
|
|
|
)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED)
|
|
|
|
target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE
|
2015-08-06 05:01:07 +08:00
|
|
|
${HDF5_F90_C_LIBSH_TARGET}
|
|
|
|
${HDF5_TEST_LIBSH_TARGET}
|
|
|
|
)
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} SHARED "F")
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (${HDF5_F90_C_TEST_LIBSH_TARGET} PROPERTIES
|
|
|
|
FOLDER libraries/test/fortran
|
|
|
|
LINKER_LANGUAGE C
|
|
|
|
)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2016-09-21 23:46:03 +08:00
|
|
|
add_custom_command (
|
2018-01-12 00:48:14 +08:00
|
|
|
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
|
2018-01-31 02:29:51 +08:00
|
|
|
COMMAND $<TARGET_FILE:H5_test_buildiface>
|
2018-01-12 00:48:14 +08:00
|
|
|
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
|
2015-09-04 21:55:29 +08:00
|
|
|
DEPENDS H5_test_buildiface
|
2016-09-21 23:46:03 +08:00
|
|
|
COMMENT "Generating the tf_gen.F90 file"
|
2015-09-04 21:55:29 +08:00
|
|
|
)
|
2016-09-21 23:46:03 +08:00
|
|
|
add_custom_target (H5testgen ALL
|
2018-01-12 00:48:14 +08:00
|
|
|
DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
|
2016-09-21 23:46:03 +08:00
|
|
|
)
|
2018-01-12 00:48:14 +08:00
|
|
|
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
|
2015-09-04 21:55:29 +08:00
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2016-09-21 23:46:03 +08:00
|
|
|
add_custom_command (
|
2018-01-12 00:48:14 +08:00
|
|
|
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
|
2018-01-31 02:29:51 +08:00
|
|
|
COMMAND $<TARGET_FILE:H5_test_buildiface>
|
2018-01-12 00:48:14 +08:00
|
|
|
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared
|
2016-09-21 23:46:03 +08:00
|
|
|
DEPENDS H5_test_buildiface
|
|
|
|
COMMENT "Generating the tf_gen.F90 shared file"
|
|
|
|
)
|
|
|
|
add_custom_target (H5testgenSH ALL
|
2018-01-12 00:48:14 +08:00
|
|
|
DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
|
2016-09-21 23:46:03 +08:00
|
|
|
)
|
2018-01-12 00:48:14 +08:00
|
|
|
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2016-09-21 23:46:03 +08:00
|
|
|
|
|
|
|
set (HDF5_F90_TF_SOURCES
|
|
|
|
# generated files
|
2018-01-12 00:48:14 +08:00
|
|
|
${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
|
2016-09-21 23:46:03 +08:00
|
|
|
|
|
|
|
# normal distribution
|
|
|
|
tf.F90
|
|
|
|
)
|
|
|
|
set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran)
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2016-09-21 23:46:03 +08:00
|
|
|
set (HDF5_F90_TF_SOURCES_SHARED
|
|
|
|
# generated file
|
2018-01-12 00:48:14 +08:00
|
|
|
${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
|
2016-09-21 23:46:03 +08:00
|
|
|
|
|
|
|
# normal distribution
|
|
|
|
tf.F90
|
|
|
|
)
|
|
|
|
set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2014-06-16 23:15:25 +08:00
|
|
|
|
2016-09-21 23:46:03 +08:00
|
|
|
add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES})
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories (${HDF5_F90_TEST_LIB_TARGET}
|
2018-04-30 22:03:29 +08:00
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
|
|
|
|
INTERFACE
|
|
|
|
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
|
|
|
target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET}
|
2018-04-30 22:03:29 +08:00
|
|
|
PRIVATE
|
2018-05-03 02:52:02 +08:00
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
|
2018-04-30 22:03:29 +08:00
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
|
|
|
|
PUBLIC
|
|
|
|
${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
|
2011-08-23 22:26:03 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2014-03-26 02:25:53 +08:00
|
|
|
set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
|
|
|
|
FOLDER libraries/test/fortran
|
2015-02-21 01:25:56 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
2015-08-06 05:01:07 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
2014-03-26 02:25:53 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0)
|
2016-09-22 01:22:16 +08:00
|
|
|
add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen)
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2016-09-21 23:46:03 +08:00
|
|
|
add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED})
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET}
|
2018-04-30 22:03:29 +08:00
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
|
|
|
|
INTERFACE
|
|
|
|
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
|
|
|
target_compile_definitions(${HDF5_F90_TEST_LIBSH_TARGET}
|
2018-04-30 22:03:29 +08:00
|
|
|
PUBLIC
|
|
|
|
"H5_BUILT_AS_DYNAMIC_LIB"
|
|
|
|
PRIVATE
|
2018-05-03 02:52:02 +08:00
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS>
|
2018-04-30 22:03:29 +08:00
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
2015-08-06 05:01:07 +08:00
|
|
|
target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET}
|
2018-04-30 22:03:29 +08:00
|
|
|
PUBLIC
|
|
|
|
${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (${HDF5_F90_TEST_LIBSH_TARGET} PROPERTIES
|
|
|
|
FOLDER libraries/test/fortran
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED "F")
|
2016-09-22 01:22:16 +08:00
|
|
|
add_dependencies(${HDF5_F90_TEST_LIBSH_TARGET} H5testgenSH)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Add Tests
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-- Adding test for testhdf5_fortran
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (testhdf5_fortran
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test.F90
|
|
|
|
tH5A.F90
|
|
|
|
tH5D.F90
|
|
|
|
tH5E.F90
|
|
|
|
tH5F.F90
|
|
|
|
tH5G.F90
|
|
|
|
tH5I.F90
|
|
|
|
tH5P.F90
|
|
|
|
tH5R.F90
|
|
|
|
tH5S.F90
|
|
|
|
tH5Sselect.F90
|
|
|
|
tH5T.F90
|
|
|
|
tH5VL.F90
|
|
|
|
tH5Z.F90
|
|
|
|
tHDF5.F90
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (testhdf5_fortran
|
|
|
|
PRIVATE
|
2018-05-03 23:44:57 +08:00
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
|
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_compile_options(testhdf5_fortran
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (testhdf5_fortran
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET testhdf5_fortran APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET testhdf5_fortran APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET testhdf5_fortran PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-03-26 06:08:46 +08:00
|
|
|
set_target_properties (testhdf5_fortran PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
2015-08-06 05:01:07 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
2015-03-26 06:08:46 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-08-06 05:01:07 +08:00
|
|
|
add_executable (testhdf5_fortran-shared
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test.F90
|
|
|
|
tH5A.F90
|
|
|
|
tH5D.F90
|
|
|
|
tH5E.F90
|
|
|
|
tH5F.F90
|
|
|
|
tH5G.F90
|
|
|
|
tH5I.F90
|
|
|
|
tH5P.F90
|
|
|
|
tH5R.F90
|
|
|
|
tH5S.F90
|
|
|
|
tH5Sselect.F90
|
|
|
|
tH5T.F90
|
|
|
|
tH5VL.F90
|
|
|
|
tH5Z.F90
|
|
|
|
tHDF5.F90
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (testhdf5_fortran-shared
|
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
|
|
|
|
)
|
|
|
|
target_compile_options(testhdf5_fortran-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (testhdf5_fortran-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET testhdf5_fortran-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (testhdf5_fortran-shared PROPERTIES
|
2018-04-30 22:03:29 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-- Adding test for testhdf5_fortran_1_8
|
2014-03-12 05:14:57 +08:00
|
|
|
add_executable (testhdf5_fortran_1_8
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test_1_8.F90
|
|
|
|
tH5O.F90
|
|
|
|
tH5A_1_8.F90
|
|
|
|
tH5G_1_8.F90
|
|
|
|
tH5MISC_1_8.F90
|
|
|
|
tHDF5_1_8.F90
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (testhdf5_fortran_1_8
|
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
|
|
|
|
)
|
|
|
|
target_compile_options(testhdf5_fortran_1_8
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (testhdf5_fortran_1_8
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET testhdf5_fortran_1_8 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-03-26 06:08:46 +08:00
|
|
|
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
2015-08-06 05:01:07 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
2015-03-26 06:08:46 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-08-06 05:01:07 +08:00
|
|
|
add_executable (testhdf5_fortran_1_8-shared
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test_1_8.F90
|
|
|
|
tH5O.F90
|
|
|
|
tH5A_1_8.F90
|
|
|
|
tH5G_1_8.F90
|
|
|
|
tH5MISC_1_8.F90
|
|
|
|
tHDF5_1_8.F90
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (testhdf5_fortran_1_8-shared
|
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
|
|
|
|
)
|
|
|
|
target_compile_options(testhdf5_fortran_1_8-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (testhdf5_fortran_1_8-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET testhdf5_fortran_1_8-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES
|
2018-04-30 22:03:29 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2011-09-30 22:01:49 +08:00
|
|
|
#-- Adding test for fortranlib_test_F03
|
2015-08-11 22:35:30 +08:00
|
|
|
add_executable (fortranlib_test_F03
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test_F03.F90
|
|
|
|
tH5E_F03.F90
|
|
|
|
tH5F_F03.F90
|
|
|
|
tH5L_F03.F90
|
|
|
|
tH5O_F03.F90
|
|
|
|
tH5P_F03.F90
|
2015-08-11 22:35:30 +08:00
|
|
|
tH5T_F03.F90
|
2015-09-01 02:49:17 +08:00
|
|
|
tHDF5_F03.F90
|
2015-08-11 22:35:30 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fortranlib_test_F03
|
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
|
|
|
|
)
|
|
|
|
target_compile_options(fortranlib_test_F03
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fortranlib_test_F03
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-11 22:35:30 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fortranlib_test_F03 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-11 22:35:30 +08:00
|
|
|
set_target_properties (fortranlib_test_F03 PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-08-11 22:35:30 +08:00
|
|
|
add_executable (fortranlib_test_F03-shared
|
2015-09-01 02:49:17 +08:00
|
|
|
fortranlib_test_F03.F90
|
|
|
|
tH5E_F03.F90
|
|
|
|
tH5F_F03.F90
|
|
|
|
tH5L_F03.F90
|
|
|
|
tH5O_F03.F90
|
|
|
|
tH5P_F03.F90
|
2015-08-11 22:35:30 +08:00
|
|
|
tH5T_F03.F90
|
2015-09-01 02:49:17 +08:00
|
|
|
tHDF5_F03.F90
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fortranlib_test_F03-shared
|
|
|
|
PRIVATE
|
|
|
|
"${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
|
|
|
|
)
|
|
|
|
target_compile_options(fortranlib_test_F03-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fortranlib_test_F03-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fortranlib_test_F03-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-11 22:35:30 +08:00
|
|
|
set_target_properties (fortranlib_test_F03-shared PROPERTIES
|
2015-08-06 05:01:07 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
2015-08-11 22:35:30 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
2015-09-01 22:56:39 +08:00
|
|
|
)
|
|
|
|
add_dependencies (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2011-09-30 22:01:49 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-- Adding test for fflush1
|
2015-09-01 02:49:17 +08:00
|
|
|
add_executable (fflush1 fflush1.F90)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fflush1
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
|
|
|
)
|
|
|
|
target_compile_options(fflush1
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fflush1
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET fflush1 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET fflush1 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fflush1 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-03-26 06:08:46 +08:00
|
|
|
set_target_properties (fflush1 PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
2015-08-06 05:01:07 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
2015-03-26 06:08:46 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-09-01 02:49:17 +08:00
|
|
|
add_executable (fflush1-shared fflush1.F90)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fflush1-shared
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
|
|
|
)
|
|
|
|
target_compile_options(fflush1-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fflush1-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET fflush1-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET fflush1-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fflush1-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (fflush1-shared PROPERTIES
|
2018-04-30 22:03:29 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (fflush1-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-- Adding test for fflush2
|
2015-09-01 02:49:17 +08:00
|
|
|
add_executable (fflush2 fflush2.F90)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fflush2
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
|
|
|
)
|
|
|
|
target_compile_options (fflush2
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fflush2
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
#set_property(TARGET fflush2 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET fflush2 APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fflush2 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-03-26 06:08:46 +08:00
|
|
|
set_target_properties (fflush2 PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
2015-08-06 05:01:07 +08:00
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
2015-03-26 06:08:46 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
2017-12-07 22:56:04 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2015-09-01 02:49:17 +08:00
|
|
|
add_executable (fflush2-shared fflush2.F90)
|
2018-04-30 22:03:29 +08:00
|
|
|
target_include_directories (fflush2-shared
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
|
|
|
)
|
|
|
|
target_compile_options(fflush2-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (fflush2-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2018-05-04 00:57:30 +08:00
|
|
|
# set_property(TARGET fflush2-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET fflush2-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
2018-05-08 05:08:42 +08:00
|
|
|
set_property(TARGET fflush2-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
2018-05-04 00:57:30 +08:00
|
|
|
endif()
|
2015-08-06 05:01:07 +08:00
|
|
|
set_target_properties (fflush2-shared PROPERTIES
|
2018-04-30 22:03:29 +08:00
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
2015-08-06 05:01:07 +08:00
|
|
|
)
|
2015-09-01 22:56:39 +08:00
|
|
|
add_dependencies (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2019-05-17 04:33:16 +08:00
|
|
|
#-- Adding test for vol_connector
|
2019-06-13 23:41:31 +08:00
|
|
|
add_executable (vol_connector
|
2019-06-14 22:48:27 +08:00
|
|
|
vol_connector.F90)
|
2019-06-13 23:41:31 +08:00
|
|
|
|
2019-05-17 04:33:16 +08:00
|
|
|
target_include_directories (vol_connector
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
|
|
|
)
|
|
|
|
target_compile_options(vol_connector
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (vol_connector
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
|
|
|
)
|
|
|
|
#set_property(TARGET vol_connector APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
#)
|
|
|
|
#set_property(TARGET vol_connector APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
#)
|
|
|
|
if(MSVC)
|
|
|
|
set_property(TARGET vol_connector PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
|
|
|
endif()
|
|
|
|
set_target_properties (vol_connector PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
|
|
|
|
)
|
|
|
|
add_dependencies (vol_connector ${HDF5_F90_TEST_LIB_TARGET})
|
|
|
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
2019-06-13 23:41:31 +08:00
|
|
|
add_executable (vol_connector-shared
|
2019-06-14 22:48:27 +08:00
|
|
|
vol_connector.F90)
|
2019-05-17 04:33:16 +08:00
|
|
|
target_include_directories (vol_connector-shared
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
|
|
|
)
|
|
|
|
target_compile_options(vol_connector-shared
|
|
|
|
PRIVATE
|
|
|
|
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
|
|
|
|
)
|
|
|
|
target_link_libraries (vol_connector-shared
|
|
|
|
PRIVATE
|
|
|
|
${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
|
|
|
)
|
|
|
|
# set_property(TARGET vol_connector-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
|
|
|
|
# )
|
|
|
|
# set_property(TARGET vol_connector-shared APPEND PROPERTY
|
|
|
|
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
|
|
|
|
# )
|
|
|
|
if(MSVC)
|
|
|
|
set_property(TARGET vol_connector-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
|
|
|
|
endif()
|
|
|
|
set_target_properties (vol_connector-shared PROPERTIES
|
|
|
|
LINKER_LANGUAGE Fortran
|
|
|
|
FOLDER test/fortran
|
|
|
|
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
|
|
|
|
)
|
|
|
|
add_dependencies (vol_connector-shared ${HDF5_F90_TEST_LIBSH_TARGET})
|
|
|
|
endif ()
|
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
include (CMakeTests.cmake)
|