diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-10-04 21:36:27 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-10-04 21:36:27 (GMT) |
commit | 342ce6b5894d8d85bcc392ac53a070574f6816c1 (patch) | |
tree | cd187d1c35146b50f929660a0c8d767102b53571 /fortran | |
parent | 155b00d8ff1b9274fefebced5954bfb0f647b4af (diff) | |
download | hdf5-342ce6b5894d8d85bcc392ac53a070574f6816c1.zip hdf5-342ce6b5894d8d85bcc392ac53a070574f6816c1.tar.gz hdf5-342ce6b5894d8d85bcc392ac53a070574f6816c1.tar.bz2 |
[svn-r19509] Improve CMake support for CYGWIN.
Correct script comment in testh5diff.sh
Tested: Windows Cygwin
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 8 | ||||
-rw-r--r-- | fortran/src/CMakeLists.txt | 44 | ||||
-rw-r--r-- | fortran/test/CMakeLists.txt | 36 | ||||
-rw-r--r-- | fortran/testpar/CMakeLists.txt | 8 |
4 files changed, 41 insertions, 55 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 04e6303..6fe6cc7 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -39,12 +39,12 @@ 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 (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -56,12 +56,12 @@ 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 (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32) + ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 21439f1..2af57c1 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -25,20 +25,18 @@ ELSE (FORTRAN_HAVE_SIZEOF) ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) ENDIF (FORTRAN_HAVE_SIZEOF) -IF (WIN32) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind - PROPERTIES - COMPILE_FLAGS "/MT" - ) - ENDIF (BUILD_SHARED_LIBS) +IF (WIN32 AND MSVC) + IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" ) - ENDIF (MSVC) -ENDIF (WIN32) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT}) @@ -53,20 +51,18 @@ ADD_CUSTOM_COMMAND ( ADD_EXECUTABLE (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 ) -IF (WIN32) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect - PROPERTIES - COMPILE_FLAGS "/MT" - ) - ENDIF (BUILD_SHARED_LIBS) +IF (WIN32 AND MSVC) + IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" + COMPILE_FLAGS "/MT" ) - ENDIF (MSVC) -ENDIF (WIN32) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT}) @@ -188,7 +184,7 @@ ENDIF (H5_HAVE_PARALLEL) # Add Main fortran library #----------------------------------------------------------------------------- ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS @@ -206,7 +202,7 @@ IF (WIN32) APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) 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 7c8c407..a536c2e 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} ) -IF (WIN32) +IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS @@ -48,7 +48,7 @@ IF (WIN32) APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32) +ENDIF (WIN32 AND NOT CYGWIN) 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}) @@ -81,11 +81,9 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>) @@ -105,11 +103,9 @@ TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>) @@ -123,11 +119,9 @@ TARGET_LINK_LIBRARIES (fflush1 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>) @@ -141,11 +135,9 @@ TARGET_LINK_LIBRARIES (fflush2 ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME fflush2 COMMAND $<TARGET_FILE:fflush2>) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 7f702da..edabb35 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -28,11 +28,9 @@ TARGET_LINK_LIBRARIES (parallel_test ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32) - IF (MSVC) - TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") - ENDIF (MSVC) -ENDIF (WIN32) +IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") +ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:parallel_test>) |