diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-10-29 17:15:13 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-10-29 17:15:13 (GMT) |
commit | 0ce736c15a393e26ede6235740dadc72bb41006c (patch) | |
tree | dd81608c0a572ff6b7615799978ede239d32a390 /fortran | |
parent | 8c26358eca11455235df239a7e9f3a225b3141da (diff) | |
download | hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.zip hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.tar.gz hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.tar.bz2 |
HDFFV-10594, HDFFV-10332, HDFFV-9059 merge from develop
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/CMakeLists.txt | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c9cc8f8..5ba8b1b 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -60,26 +60,22 @@ else () endif () endif () -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -# target_compile_definitions(H5test_FortranHavekind-shared -# PRIVATE -# $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT> -# ) - if (MSVC) - set_property(TARGET H5test_FortranHavekind-shared PROPERTY COMPILE_FLAGS "/MT") - endif () -endif () +set_target_properties (H5test_FortranHavekind PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static +) #set_property(TARGET H5test_FortranHavekind APPEND PROPERTY # LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> #) +#target_compile_definitions(H5test_FortranHavekind-shared +# PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT> +#) if (MSVC) - set_property(TARGET H5test_FortranHavekind PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") + set_target_properties (H5test_FortranHavekind PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" + ) endif () - -set_target_properties (H5test_FortranHavekind PROPERTIES - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static -) target_include_directories(H5test_FortranHavekind PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}" @@ -89,11 +85,28 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) +# set_property(TARGET H5test_FortranHavekind APPEND PROPERTY +# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> +# ) +# target_compile_definitions(H5test_FortranHavekind-shared +# PRIVATE +# $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT> +# ) + if (MSVC) + set_target_properties (H5test_FortranHavekind-shared PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" + ) + endif () + target_include_directories(H5test_FortranHavekind-shared + PRIVATE + "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}" + ) endif () add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 - COMMAND $<TARGET_FILE:H5test_FortranHavekind> + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5test_FortranHavekind> ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5test_FortranHavekind @@ -127,7 +140,7 @@ set_target_properties (H5fortran_detect PROPERTIES add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h - COMMAND $<TARGET_FILE:H5fortran_detect> + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5fortran_detect> ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5fortran_detect |