summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-09-09 16:30:23 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-09-09 16:30:23 (GMT)
commitbed127641399ec6c6e1479b7c394fd3a4eb56438 (patch)
treebd923e43fb7c5a004a94f038b6c087d1d170f739 /fortran
parenta5b16bbd75dddc008480448d458cb0a1b7ba70fa (diff)
downloadhdf5-bed127641399ec6c6e1479b7c394fd3a4eb56438.zip
hdf5-bed127641399ec6c6e1479b7c394fd3a4eb56438.tar.gz
hdf5-bed127641399ec6c6e1479b7c394fd3a4eb56438.tar.bz2
[svn-r19361] Move Windows specific compile and link flags to macros
Diffstat (limited to 'fortran')
-rw-r--r--fortran/examples/CMakeLists.txt38
-rw-r--r--fortran/test/CMakeLists.txt52
-rw-r--r--fortran/testpar/CMakeLists.txt13
3 files changed, 9 insertions, 94 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index f1ed52f..04e6303 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -38,63 +38,33 @@ SET (examples
FOREACH (example ${examples})
ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
H5_NAMING (f90_ex_${example})
+ TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example})
IF (WIN32)
- IF (BUILD_SHARED_LIBS)
- IF (MSVC)
- SET_TARGET_PROPERTIES (f90_ex_${example}
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ENDIF (MSVC)
- ELSE (BUILD_SHARED_LIBS)
- IF (MSVC)
- SET_TARGET_PROPERTIES (f90_ex_${example}
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (MSVC)
- ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET f90_ex_${example}
APPEND PROPERTY COMPILE_DEFINITIONS
HDF5F90_WINDOWS
)
- SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES (f90_ex_${example}
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
)
+ SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
ENDFOREACH (example ${examples})
IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
H5_NAMING (f90_ex_ph5example)
+ TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example)
IF (WIN32)
- IF (BUILD_SHARED_LIBS)
- IF (MSVC)
- SET_TARGET_PROPERTIES (f90_ex_ph5example
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ENDIF (MSVC)
- ELSE (BUILD_SHARED_LIBS)
- IF (MSVC)
- SET_TARGET_PROPERTIES (f90_ex_ph5example
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (MSVC)
- ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET f90_ex_ph5example
APPEND PROPERTY COMPILE_DEFINITIONS
HDF5F90_WINDOWS
)
- SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES (f90_ex_ph5example
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
)
+ SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran)
ENDIF (H5_HAVE_PARALLEL)
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 26475e6..7c8c407 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -75,6 +75,7 @@ ADD_EXECUTABLE (testhdf5_fortran
tH5Z.f90
)
H5_NAMING (testhdf5_fortran)
+TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran)
TARGET_LINK_LIBRARIES (testhdf5_fortran
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -83,18 +84,6 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran
IF (WIN32)
IF (MSVC)
TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib")
- IF (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (testhdf5_fortran
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ELSE (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (testhdf5_fortran
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (BUILD_SHARED_LIBS)
ENDIF (MSVC)
ENDIF (WIN32)
SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran)
@@ -110,6 +99,7 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8
tH5G_1_8.f90
)
H5_NAMING (testhdf5_fortran_1_8)
+TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran_1_8)
TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -118,18 +108,6 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8
IF (WIN32)
IF (MSVC)
TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib")
- IF (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (testhdf5_fortran_1_8
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ELSE (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (testhdf5_fortran_1_8
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (BUILD_SHARED_LIBS)
ENDIF (MSVC)
ENDIF (WIN32)
SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran)
@@ -139,6 +117,7 @@ ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
#-- Adding test for fflush1
ADD_EXECUTABLE (fflush1 fflush1.f90)
H5_NAMING (fflush1)
+TARGET_FORTRAN_WIN_PROPERTIES (fflush1)
TARGET_LINK_LIBRARIES (fflush1
${HDF5_F90_LIB_TARGET}
${HDF5_F90_TEST_LIB_TARGET}
@@ -147,18 +126,6 @@ TARGET_LINK_LIBRARIES (fflush1
IF (WIN32)
IF (MSVC)
TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib")
- IF (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (fflush1
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ELSE (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (fflush1
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (BUILD_SHARED_LIBS)
ENDIF (MSVC)
ENDIF (WIN32)
SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran)
@@ -168,6 +135,7 @@ ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>)
#-- Adding test for fflush2
ADD_EXECUTABLE (fflush2 fflush2.f90)
H5_NAMING (fflush2)
+TARGET_FORTRAN_WIN_PROPERTIES (fflush2)
TARGET_LINK_LIBRARIES (fflush2
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -176,18 +144,6 @@ TARGET_LINK_LIBRARIES (fflush2
IF (WIN32)
IF (MSVC)
TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib")
- IF (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (fflush2
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ELSE (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (fflush2
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (BUILD_SHARED_LIBS)
ENDIF (MSVC)
ENDIF (WIN32)
SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran)
diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt
index 4b9d4f1..7f702da 100644
--- a/fortran/testpar/CMakeLists.txt
+++ b/fortran/testpar/CMakeLists.txt
@@ -22,6 +22,7 @@ ADD_EXECUTABLE (parallel_test
mdset.f90
)
H5_NAMING (parallel_test)
+TARGET_FORTRAN_WIN_PROPERTIES (parallel_test)
TARGET_LINK_LIBRARIES (parallel_test
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -30,18 +31,6 @@ TARGET_LINK_LIBRARIES (parallel_test
IF (WIN32)
IF (MSVC)
TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib")
- IF (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (parallel_test
- PROPERTIES
- COMPILE_FLAGS "/dll"
- LINK_FLAGS "/SUBSYSTEM:CONSOLE"
- )
- ELSE (BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES (parallel_test
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- )
- ENDIF (BUILD_SHARED_LIBS)
ENDIF (MSVC)
ENDIF (WIN32)
SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran)