diff options
Diffstat (limited to 'fortran/src/CMakeLists.txt')
-rw-r--r-- | fortran/src/CMakeLists.txt | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c2ca1e6..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}") @@ -223,7 +219,7 @@ INSTALL ( ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 DESTINATION - include/fortran + ${HDF5_INSTALL_INCLUDE_DIR}/fortran COMPONENT fortheaders ) @@ -232,7 +228,7 @@ INSTALL ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - include/fortran + ${HDF5_INSTALL_INCLUDE_DIR}/fortran COMPONENT fortheaders ) @@ -247,8 +243,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_F90_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION lib COMPONENT fortlibraries - ARCHIVE DESTINATION lib COMPONENT fortlibraries - RUNTIME DESTINATION bin COMPONENT fortlibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT fortlibraries ) ENDIF (HDF5_EXPORTED_TARGETS) |