summaryrefslogtreecommitdiffstats
path: root/hl/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-04-30 14:03:29 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-04-30 14:03:29 (GMT)
commit76d0cc0ca992e3f373c64ddc578ebfed09c77455 (patch)
treefc76278eee4526f38688aff3d0b5afd1431ff74c /hl/fortran
parent80afe46e70a824086f4744081eaf92836639109d (diff)
downloadhdf5-76d0cc0ca992e3f373c64ddc578ebfed09c77455.zip
hdf5-76d0cc0ca992e3f373c64ddc578ebfed09c77455.tar.gz
hdf5-76d0cc0ca992e3f373c64ddc578ebfed09c77455.tar.bz2
TRILABS-19 Refactor fortran properties
Diffstat (limited to 'hl/fortran')
-rw-r--r--hl/fortran/examples/CMakeLists.txt26
-rw-r--r--hl/fortran/src/CMakeLists.txt57
-rw-r--r--hl/fortran/test/CMakeLists.txt196
3 files changed, 207 insertions, 72 deletions
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index db047d0..7805ff4 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -8,17 +8,25 @@ set (examples
foreach (example ${examples})
add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (hl_f90_ex_${example} PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ target_include_directories (hl_f90_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
- TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} STATIC)
- target_link_libraries (hl_f90_ex_${example} PRIVATE
- ${HDF5_HL_F90_LIB_TARGET}
- ${HDF5_F90_LIB_TARGET}
- ${HDF5_LIB_TARGET}
+ target_compile_options(hl_f90_ex_${example}
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (hl_f90_ex_${example}
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ )
+ set_target_properties (hl_f90_ex_${example} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/hl/fortran
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
- set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
- set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran)
endforeach ()
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 6e808c3..ffe8f16 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -149,49 +149,68 @@ endif ()
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
target_include_directories (${HDF5_HL_F90_LIB_TARGET}
- PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ PRIVATE
+ "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
-target_compile_definitions(${HDF5_LIBSH_TARGET}
- PUBLIC $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"HDF5F90_WINDOWS">
+target_compile_definitions(${HDF5_HL_F90_LIB_TARGET}
+ PUBLIC
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"HDF5F90_WINDOWS">
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_HL_F90_LIB_TARGET}
- PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
+ PUBLIC
+ ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0)
set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
FOLDER libraries/hl/fortran
LINKER_LANGUAGE Fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
+H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0)
+set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET})
add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen)
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
target_include_directories (${HDF5_HL_F90_LIBSH_TARGET}
- PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ PRIVATE
+ "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_definitions(${HDF5_LIBSH_TARGET}
- PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS">
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
+ target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET}
+ PUBLIC
+ "H5_BUILT_AS_DYNAMIC_LIB"
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/dll">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET}
- PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
- PRIVATE ${LINK_Fortran_LIBS}
- INTERFACE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def">
+ PUBLIC
+ ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
+ PRIVATE
+ ${LINK_Fortran_LIBS}
+ INTERFACE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def">
)
- set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED "HL_F")
set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES
FOLDER libraries/hl/fortran
LINKER_LANGUAGE Fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
+ H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_LIB_NAME} SHARED "HL_F")
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}")
set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET})
add_dependencies(${HDF5_HL_F90_LIBSH_TARGET} H5HLgenSH)
endif ()
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index d5aac56..074d87a 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -7,77 +7,185 @@ project (HDF5_HL_FORTRAN_TESTS C Fortran)
#-- Adding test for hl_f90_tstds
add_executable (hl_f90_tstds tstds.F90)
-target_include_directories (hl_f90_tstds PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
-TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC)
-target_link_libraries (hl_f90_tstds PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
-set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran)
-set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran)
+target_include_directories (hl_f90_tstds
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+)
+target_compile_options(hl_f90_tstds
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+)
+target_link_libraries (hl_f90_tstds
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
+)
+set_target_properties (hl_f90_tstds PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+)
if (BUILD_SHARED_LIBS)
add_executable (hl_f90_tstds-shared tstds.F90)
- target_include_directories (hl_f90_tstds-shared PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
- TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED)
- target_link_libraries (hl_f90_tstds-shared PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET})
+ target_include_directories (hl_f90_tstds-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_compile_options(hl_f90_tstds-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/dll">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (hl_f90_tstds-shared
+ PRIVATE
+ ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
+ )
set_target_properties (hl_f90_tstds-shared PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
endif ()
#-- Adding test for hl_f90_tstlite
add_executable (hl_f90_tstlite tstlite.F90)
-target_include_directories (hl_f90_tstlite PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
-TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC)
-target_link_libraries (hl_f90_tstlite PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET})
-set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran)
-set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran)
+target_include_directories (hl_f90_tstlite
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+)
+target_compile_options(hl_f90_tstlite
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+)
+target_link_libraries (hl_f90_tstlite
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
+)
+set_target_properties (hl_f90_tstlite PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+)
if (BUILD_SHARED_LIBS)
add_executable (hl_f90_tstlite-shared tstlite.F90)
- target_include_directories (hl_f90_tstlite-shared PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
- TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED)
- target_link_libraries (hl_f90_tstlite-shared PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET})
+ target_include_directories (hl_f90_tstlite-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_compile_options(hl_f90_tstlite-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/dll">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (hl_f90_tstlite-shared
+ PRIVATE
+ ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}
+ )
set_target_properties (hl_f90_tstlite-shared PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
endif ()
#-- Adding test for hl_f90_tstimage
add_executable (hl_f90_tstimage tstimage.F90)
-target_include_directories (hl_f90_tstimage PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
-TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC)
-target_link_libraries (hl_f90_tstimage PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
-set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran)
-set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran)
+target_include_directories (hl_f90_tstimage
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+)
+target_compile_options(hl_f90_tstimage
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+)
+target_link_libraries (hl_f90_tstimage
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
+)
+set_target_properties (hl_f90_tstimage PROPERTIES
+ FOLDER test/hl/fortran
+ LINKER_LANGUAGE Fortran
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+)
if (BUILD_SHARED_LIBS)
add_executable (hl_f90_tstimage-shared tstimage.F90)
- target_include_directories (hl_f90_tstimage-shared PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
- TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED)
- target_link_libraries (hl_f90_tstimage-shared PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET})
+ target_include_directories (hl_f90_tstimage-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_compile_options(hl_f90_tstimage-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/dll">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (hl_f90_tstimage-shared
+ PRIVATE
+ ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
+ )
set_target_properties (hl_f90_tstimage-shared PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
endif ()
#-- Adding test for hl_f90_tsttable
add_executable (hl_f90_tsttable tsttable.F90)
-target_include_directories (hl_f90_tsttable PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
-TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC)
-target_link_libraries (hl_f90_tsttable PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET})
-set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran)
-set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran)
+target_include_directories (hl_f90_tsttable
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+)
+target_compile_options(hl_f90_tsttable
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+)
+target_link_libraries (hl_f90_tsttable
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
+)
+set_target_properties (hl_f90_tsttable PROPERTIES
+ FOLDER test/hl/fortran
+ LINKER_LANGUAGE Fortran
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+)
if (BUILD_SHARED_LIBS)
add_executable (hl_f90_tsttable-shared tsttable.F90)
- target_include_directories (hl_f90_tsttable-shared PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src")
- TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED)
- target_link_libraries (hl_f90_tsttable-shared PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET})
+ target_include_directories (hl_f90_tsttable-shared
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_compile_options(hl_f90_tsttable-shared
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/dll">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (hl_f90_tsttable-shared
+ PRIVATE
+ ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}
+ )
set_target_properties (hl_f90_tsttable-shared PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ LINK_FLAGS
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"/SUBSYSTEM:CONSOLE">
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
)
endif ()