summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/HDFMacros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake_ext_mod/HDFMacros.cmake')
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake40
1 files changed, 9 insertions, 31 deletions
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 04d60e1..791fe2e 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -219,37 +219,15 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
endmacro ()
#-------------------------------------------------------------------------------
-macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags)
- if (MSVC)
- TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
- else ()
- set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags)
- if (MSVC)
- set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags)
- if (WIN32)
- TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags)
- if (MSVC)
- if (${libtype} MATCHES "SHARED")
- set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}")
- else ()
- set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}")
- endif ()
- endif ()
+macro (TARGET_C_PROPERTIES wintarget libtype)
+ target_compile_options(${wintarget} PRIVATE
+ $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
+ $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries(${wintarget} INTERFACE
+ $<$<C_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}>
+ $<$<CXX_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}>
+ )
endmacro ()
#-----------------------------------------------------------------------------