mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r26161] Fix cmake case.
Turn on F2003 by default. Set source properties in fortran cmake files.
This commit is contained in:
parent
1b78408184
commit
ab75986b8c
@ -45,9 +45,9 @@ option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF)
|
||||
if (HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
if (NOT H5_ZLIB_HEADER)
|
||||
if (NOT ZLIB_USE_EXTERNAL)
|
||||
FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
if (NOT ZLIB_FOUND)
|
||||
FIND_PACKAGE (ZLIB) # Legacy find
|
||||
find_package (ZLIB) # Legacy find
|
||||
endif (NOT ZLIB_FOUND)
|
||||
endif (NOT ZLIB_USE_EXTERNAL)
|
||||
if (ZLIB_FOUND)
|
||||
@ -89,9 +89,9 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
|
||||
if (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
|
||||
if (NOT SZIP_USE_EXTERNAL)
|
||||
FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
if (NOT SZIP_FOUND)
|
||||
FIND_PACKAGE (SZIP) # Legacy find
|
||||
find_package (SZIP) # Legacy find
|
||||
endif (NOT SZIP_FOUND)
|
||||
endif (NOT SZIP_USE_EXTERNAL)
|
||||
if (SZIP_FOUND)
|
||||
|
@ -63,9 +63,9 @@ set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR})
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the build directory
|
||||
#-----------------------------------------------------------------------------
|
||||
set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR )
|
||||
set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
|
||||
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
|
||||
set (SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
|
||||
configure_package_config_file (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
|
||||
"${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
|
||||
@ -92,14 +92,14 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
set(INCLUDE_INSTALL_DIR HDF5_INSTALL_INCLUDE_DIR )
|
||||
set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set(CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
|
||||
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
|
||||
set (SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
|
||||
configure_package_config_file (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
|
||||
"${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
|
||||
INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
|
||||
PATH_VARS HDF5_INSTALL_INCLUDE_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
|
||||
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
|
||||
)
|
||||
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
@ -805,7 +805,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
|
||||
if (BUILD_SHARED_LIBS AND APPLE)
|
||||
message (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ")
|
||||
endif (BUILD_SHARED_LIBS AND APPLE)
|
||||
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF)
|
||||
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
|
||||
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
|
||||
if (HDF5_ENABLE_F2003)
|
||||
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype)
|
||||
macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
|
||||
set (LIB_OUT_NAME "${libname}")
|
||||
if (${libtype} MATCHES "SHARED")
|
||||
if (WIN32)
|
||||
@ -28,4 +28,4 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype)
|
||||
endif (HDF5_BUILD_WITH_INSTALL_NAME)
|
||||
endif (APPLE)
|
||||
|
||||
ENDMACRO (H5_SET_LIB_OPTIONS)
|
||||
endmacro (H5_SET_LIB_OPTIONS)
|
||||
|
@ -16,7 +16,7 @@ set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
|
||||
|
||||
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
|
||||
|
||||
set (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
|
||||
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
|
||||
|
||||
|
@ -16,7 +16,7 @@ set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
|
||||
|
||||
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
|
||||
|
||||
set (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
|
||||
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
|
||||
|
||||
|
@ -132,7 +132,6 @@ if (H5_HAVE_PARALLEL)
|
||||
${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c
|
||||
)
|
||||
endif (H5_HAVE_PARALLEL)
|
||||
|
||||
set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C)
|
||||
|
||||
set (f90CStub_C_HDRS
|
||||
@ -224,6 +223,7 @@ else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
|
||||
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90
|
||||
)
|
||||
endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
|
||||
set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add Main fortran library
|
||||
@ -255,6 +255,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF
|
||||
H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE})
|
||||
set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES
|
||||
FOLDER libraries/fortran
|
||||
LINKER_LANGUAGE Fortran
|
||||
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
||||
)
|
||||
|
||||
|
@ -11,11 +11,13 @@ set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSIO
|
||||
#-- Adding test for testhdf5_fortran_1_8
|
||||
add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
|
||||
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
|
||||
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran)
|
||||
|
||||
#-- Adding test for fortranlib_test_F03
|
||||
if (HDF5_ENABLE_F2003)
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
|
||||
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
|
||||
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
|
||||
endif (HDF5_ENABLE_F2003)
|
||||
|
||||
#-- Adding test for fflush1
|
||||
|
@ -379,7 +379,7 @@ These five steps are described in detail below.
|
||||
set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
|
||||
set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
|
||||
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
|
||||
set (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
|
||||
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
|
||||
set (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
|
||||
set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
|
||||
@ -552,7 +552,7 @@ HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF
|
||||
HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF
|
||||
HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF
|
||||
if (HDF5_BUILD_FORTRAN)
|
||||
HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF
|
||||
HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON
|
||||
|
||||
---------------- HDF5 Advanced Options ---------------------
|
||||
HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF
|
||||
@ -714,8 +714,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
|
||||
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")
|
||||
|
||||
#### fortran ####
|
||||
### enable Fortran 2003
|
||||
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
|
||||
### disable Fortran 2003
|
||||
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
|
||||
### disable Fortran
|
||||
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
|
||||
|
||||
|
@ -71,8 +71,7 @@ Preconditions:
|
||||
http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html.
|
||||
|
||||
The latest supported public release of SZIP is available from
|
||||
ftp://ftp.hdfgroup.org/lib-external/szip/2.1. Binary distribution can be
|
||||
found under ftp://ftp.hdfgroup.org/lib-external/szip/2.1/bin/cygwin
|
||||
ftp://ftp.hdfgroup.org/lib-external/szip/2.1.
|
||||
|
||||
|
||||
2.3 Additional Utilities
|
||||
|
@ -877,8 +877,8 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
|
||||
option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF)
|
||||
if (HDF5_ENABLE_DEBUG_APIS)
|
||||
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
|
||||
COMPILE_DEFINITIONS
|
||||
"H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
|
||||
COMPILE_DEFINITIONS
|
||||
"H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
|
||||
)
|
||||
endif (HDF5_ENABLE_DEBUG_APIS)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user