summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-05-02 20:42:38 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-05-02 20:42:38 (GMT)
commitd906f2dcc5de59adde8335107d7fc9631a47face (patch)
treede89108fea74ffa945a84c76fa9f445e697ddaec /fortran/src
parentd3a49988eb82bd44cfb426014e99952a3de6c823 (diff)
downloadhdf5-d906f2dcc5de59adde8335107d7fc9631a47face.zip
hdf5-d906f2dcc5de59adde8335107d7fc9631a47face.tar.gz
hdf5-d906f2dcc5de59adde8335107d7fc9631a47face.tar.bz2
refactor link flags to interface
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index f21a9ba..c4df92f 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -43,16 +43,21 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID)
# H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.F90
#-----------------------------------------------------------------------------
-add_executable (H5_buildiface
- ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90
+add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90)
+target_include_directories(H5_buildiface
+ PRIVATE
+ "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}"
+)
+if (BUILD_SHARED_LIBS)
+ target_compile_definitions(H5_buildiface
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>
)
-target_include_directories(H5_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}")
-if (WIN32 AND MSVC)
- if (BUILD_SHARED_LIBS)
- set_target_properties (H5_buildiface PROPERTIES COMPILE_FLAGS "/MT")
- endif ()
- set_target_properties (H5_buildiface PROPERTIES LINK_FLAGS "-SUBSYSTEM:CONSOLE")
endif ()
+target_link_libraries (H5_buildiface
+ INTERFACE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+)
set_target_properties (H5_buildiface PROPERTIES
LINKER_LANGUAGE Fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}