summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-01-05 15:03:50 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-01-05 15:03:50 (GMT)
commit96b2abb9bd2d1ef1f890d3767d6471801a1a30e6 (patch)
tree8220fb90a2e2541f9f420c1130b835d56d819a8a /fortran
parent02888be7f2b3ec1c5d8c388dd3873645020d1e48 (diff)
downloadhdf5-96b2abb9bd2d1ef1f890d3767d6471801a1a30e6.zip
hdf5-96b2abb9bd2d1ef1f890d3767d6471801a1a30e6.tar.gz
hdf5-96b2abb9bd2d1ef1f890d3767d6471801a1a30e6.tar.bz2
[svn-r19910] Change how LINK_FLAGS for fortran are appended on Windows - correct for just shared libs
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/CMakeLists.txt6
-rw-r--r--fortran/test/CMakeLists.txt8
2 files changed, 8 insertions, 6 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 9da2af7..25101b6 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -184,19 +184,23 @@ ENDIF (H5_HAVE_PARALLEL)
# Add Main fortran library
#-----------------------------------------------------------------------------
ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS})
-TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def")
+SET (SHARED_LINK_FLAGS "")
IF (WIN32 AND NOT CYGWIN)
IF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
BUILD_HDF5_DLL
)
+ IF (MSVC)
+ SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def")
+ ENDIF (MSVC)
ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
HDF5F90_WINDOWS
)
ENDIF (WIN32 AND NOT CYGWIN)
+TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 775e5c5..d054ee6 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -30,7 +30,7 @@ ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90)
ADD_DEPENDENCIES(${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_C_TEST_LIB_TARGET}
)
-TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} "/DLL")
+SET (SHARED_LINK_FLAGS "")
IF (WIN32 AND NOT CYGWIN)
IF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET}
@@ -38,10 +38,7 @@ IF (WIN32 AND NOT CYGWIN)
BUILD_HDF5_DLL
)
IF (MSVC)
- SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET}
- APPEND PROPERTY LINK_FLAGS
- "/DLL"
- )
+ SET (SHARED_LINK_FLAGS "/DLL")
ENDIF (MSVC)
ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET}
@@ -49,6 +46,7 @@ IF (WIN32 AND NOT CYGWIN)
HDF5F90_WINDOWS
)
ENDIF (WIN32 AND NOT CYGWIN)
+TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE})