diff options
89 files changed, 4045 insertions, 4045 deletions
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index bc78fa6..1a74460 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -3,12 +3,12 @@ # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) - OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) - IF (HDF5_USE_FILTER_${FILTER}) - SET (H5_HAVE_FILTER_${FILTER} 1) - SET (FILTERS "${FILTERS} ${FILTER}") - ENDIF (HDF5_USE_FILTER_${FILTER}) - # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") + option (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) + if (HDF5_USE_FILTER_${FILTER}) + set (H5_HAVE_FILTER_${FILTER} 1) + set (FILTERS "${FILTERS} ${FILTER}") + endif (HDF5_USE_FILTER_${FILTER}) + # message (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") ENDMACRO (HDF5_SETUP_FILTERS) HDF5_SETUP_FILTERS (SHUFFLE) @@ -16,107 +16,107 @@ HDF5_SETUP_FILTERS (FLETCHER32) HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) -INCLUDE (ExternalProject) -OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) - OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_URL ${ZLIB_SVN_URL}) - SET (SZIP_URL ${SZIP_SVN_URL}) - ELSEIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (NOT TGZPATH) - SET (TGZPATH ${HDF5_SOURCE_DIR}) - ENDIF (NOT TGZPATH) - SET (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) - SET (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_USE_EXTERNAL 0) - SET (SZIP_USE_EXTERNAL 0) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +include (ExternalProject) +option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) + option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_URL ${ZLIB_SVN_URL}) + set (SZIP_URL ${SZIP_SVN_URL}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${HDF5_SOURCE_DIR}) + endif (NOT TGZPATH) + set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) + set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_USE_EXTERNAL 0) + set (SZIP_USE_EXTERNAL 0) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support #----------------------------------------------------------------------------- -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) +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}) - IF (NOT ZLIB_FOUND) + if (NOT ZLIB_FOUND) FIND_PACKAGE (ZLIB) # Legacy find - ENDIF (NOT ZLIB_FOUND) - ENDIF (NOT ZLIB_USE_EXTERNAL) - IF (ZLIB_FOUND) - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - SET (H5_ZLIB_HEADER "zlib.h") - SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - ELSE (ZLIB_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT ZLIB_FOUND) + endif (NOT ZLIB_USE_EXTERNAL) + if (ZLIB_FOUND) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + set (H5_ZLIB_HEADER "zlib.h") + set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + else (ZLIB_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - MESSAGE (STATUS "Filter ZLIB is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (ZLIB_FOUND) - ELSE (NOT H5_ZLIB_HEADER) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + message (STATUS "Filter ZLIB is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (ZLIB_FOUND) + else (NOT H5_ZLIB_HEADER) # This project is being called from within another and ZLib is already configured - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - ENDIF (NOT H5_ZLIB_HEADER) - IF (H5_HAVE_FILTER_DEFLATE) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - ENDIF (H5_HAVE_FILTER_DEFLATE) - SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + endif (NOT H5_ZLIB_HEADER) + if (H5_HAVE_FILTER_DEFLATE) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") + endif (H5_HAVE_FILTER_DEFLATE) + set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - MESSAGE (STATUS "Filter ZLIB is ON") -ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) + message (STATUS "Filter ZLIB is ON") +endif (HDF5_ENABLE_Z_LIB_SUPPORT) #----------------------------------------------------------------------------- # Option for SzLib support #----------------------------------------------------------------------------- -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) +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}) - IF (NOT SZIP_FOUND) + if (NOT SZIP_FOUND) FIND_PACKAGE (SZIP) # Legacy find - ENDIF (NOT SZIP_FOUND) - ENDIF (NOT SZIP_USE_EXTERNAL) - IF (SZIP_FOUND) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - ELSE (SZIP_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT SZIP_FOUND) + endif (NOT SZIP_USE_EXTERNAL) + if (SZIP_FOUND) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + else (SZIP_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING}) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - MESSAGE (STATUS "Filter SZIP is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (SZIP_FOUND) - SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + message (STATUS "Filter SZIP is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND) + set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR}) - MESSAGE (STATUS "Filter SZIP is ON") - IF (H5_HAVE_FILTER_SZIP) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - ENDIF (H5_HAVE_FILTER_SZIP) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (H5_HAVE_SZIP_ENCODER 1) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) -ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + message (STATUS "Filter SZIP is ON") + if (H5_HAVE_FILTER_SZIP) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") + endif (H5_HAVE_FILTER_SZIP) + if (HDF5_ENABLE_SZIP_ENCODING) + set (H5_HAVE_SZIP_ENCODER 1) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") + endif (HDF5_ENABLE_SZIP_ENCODING) +endif (HDF5_ENABLE_SZIP_SUPPORT) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 1d74786..6506e15 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -2,46 +2,46 @@ #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${PROJECT_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( EXPORT ${HDF5_EXPORTED_TARGETS} DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Export all exported targets to the build tree for use by parent project #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) EXPORT ( TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the build directory #----------------------------------------------------------------------------- -SET (HDF5_INCLUDES_BUILD_TIME +set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} ${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR} ) -SET (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) -SET (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) -SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) +set (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) +set (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) +set (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in @@ -51,61 +51,61 @@ CONFIGURE_FILE ( #----------------------------------------------------------------------------- # Configure the FindHDF5.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- -IF (H5_WORDS_BIGENDIAN) - SET (BYTESEX big-endian) -ELSE (H5_WORDS_BIGENDIAN) - SET (BYTESEX little-endian) -ENDIF (H5_WORDS_BIGENDIAN) +if (H5_WORDS_BIGENDIAN) + set (BYTESEX big-endian) +else (H5_WORDS_BIGENDIAN) + set (BYTESEX little-endian) +endif (H5_WORDS_BIGENDIAN) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY ) -INSTALL ( +install ( FILES ${HDF5_BINARY_DIR}/libhdf5.settings DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT libraries @@ -114,70 +114,70 @@ INSTALL ( #----------------------------------------------------------------------------- # Configure the HDF518_Examples.cmake file and the examples #----------------------------------------------------------------------------- -OPTION (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) -IF (HDF5_PACK_EXAMPLES) +option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) +if (HDF5_PACK_EXAMPLES) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/HDF518_Examples.cmake.in ${HDF5_BINARY_DIR}/HDF518_Examples.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/HDF518_Examples.cmake DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") - INSTALL ( + if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") + install ( FILES ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED} ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") -ENDIF (HDF5_PACK_EXAMPLES) + endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") +endif (HDF5_PACK_EXAMPLES) #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package #----------------------------------------------------------------------------- -SET (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) -SET (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") -IF (WIN32) - SET (BINARY_EXAMPLE_ENDING "zip") - SET (BINARY_INSTALL_ENDING "exe") - IF (CMAKE_CL_64) - SET (BINARY_SYSTEM_NAME "win64") - ELSE (CMAKE_CL_64) - SET (BINARY_SYSTEM_NAME "win32") - ENDIF (CMAKE_CL_64) - IF (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} 7") - ELSEIF (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} 8") - ENDIF (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - IF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") - ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") - ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") - ELSE (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") - ENDIF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") -ELSEIF (APPLE) - SET (BINARY_EXAMPLE_ENDING "tar.gz") - SET (BINARY_INSTALL_ENDING "dmg") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") -ELSE (WIN32) - SET (BINARY_EXAMPLE_ENDING "tar.gz") - SET (BINARY_INSTALL_ENDING "sh") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") -ENDIF (WIN32) -IF (HDF4_BUILD_FORTRAN) - SET (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") -ENDIF (HDF4_BUILD_FORTRAN) +set (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) +set (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") +if (WIN32) + set (BINARY_EXAMPLE_ENDING "zip") + set (BINARY_INSTALL_ENDING "exe") + if (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win64") + else (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win32") + endif (CMAKE_CL_64) + if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") + elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") + endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") +elseif (APPLE) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "dmg") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +else (WIN32) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "sh") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +endif (WIN32) +if (HDF4_BUILD_FORTRAN) + set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") +endif (HDF4_BUILD_FORTRAN) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/README.txt.cmake.in @@ -187,130 +187,130 @@ CONFIGURE_FILE ( #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( FILES ${HDF5_SOURCE_DIR}/COPYING DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") - SET (release_files + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") + set (release_files ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) - IF (WIN32 AND NOT CYGWIN) - SET (release_files + if (WIN32 AND NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - ENDIF (WIN32 AND NOT CYGWIN) - IF (HDF5_PACK_INSTALL_DOCS) - SET (release_files + endif (WIN32 AND NOT CYGWIN) + if (HDF5_PACK_INSTALL_DOCS) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - IF (WIN32) - IF (NOT CYGWIN) - SET (release_files + if (WIN32) + if (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - ELSE (NOT CYGWIN) - SET (release_files + else (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - ENDIF (NOT CYGWIN) - ENDIF (WIN32) - IF (HDF5_ENABLE_PARALLEL) - SET (release_files + endif (NOT CYGWIN) + endif (WIN32) + if (HDF5_ENABLE_PARALLEL) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - ENDIF (HDF5_ENABLE_PARALLEL) - ENDIF (HDF5_PACK_INSTALL_DOCS) - INSTALL ( + endif (HDF5_ENABLE_PARALLEL) + endif (HDF5_PACK_INSTALL_DOCS) + install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) - SET (CPACK_PACKAGE_VENDOR "HDF_Group") - SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - IF (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - ELSE (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") - ENDIF (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") - SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") - SET (CPACK_PACKAGE_VERSION_PATCH "") - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") - SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_RELOCATABLE TRUE) - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") +if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) + set (CPACK_PACKAGE_VENDOR "HDF_Group") + set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") + if (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") + else (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") + endif (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") + set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") + set (CPACK_PACKAGE_VERSION_PATCH "") + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_RELOCATABLE TRUE) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") - SET (CPACK_GENERATOR "TGZ") - IF (WIN32) + set (CPACK_GENERATOR "TGZ") + if (WIN32) LIST (APPEND CPACK_GENERATOR "NSIS") # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation - SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") - IF (CMAKE_CL_64) - SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - ELSE (CMAKE_CL_64) - SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - ENDIF (CMAKE_CL_64) + set (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") + if (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") + else (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") + endif (CMAKE_CL_64) # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. - SET (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") - SET (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + set (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + set (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") # set the package header icon for MUI - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") - SET (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - SET (CPACK_MONOLITHIC_INSTALL ON) - SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") - SET (CPACK_NSIS_MODIFY_PATH ON) - ELSEIF (APPLE) + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") + set (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") + set (CPACK_MONOLITHIC_INSTALL ON) + set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_NSIS_MODIFY_PATH ON) + elseif (APPLE) LIST (APPEND CPACK_GENERATOR "DragNDrop") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") - SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") + set (CPACK_PACKAGING_INSTALL_PREFIX "/") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". - IF (HDF5_PACK_MACOSX_BUNDLE) + if (HDF5_PACK_MACOSX_BUNDLE) LIST (APPEND CPACK_GENERATOR "Bundle") - SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / - SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") - SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") - SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") - SET (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") - SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") - SET (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") - SET (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") - SET (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / + set (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") + set (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") + set (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") + set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") + set (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") + set (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") #----------------------------------------------------------------------------- # Configure the Info.plist file for the install bundle #----------------------------------------------------------------------------- @@ -326,29 +326,29 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) ${HDF5_RESOURCES_DIR}/version.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo ${HDF5_BINARY_DIR}/CMakeFiles/version.plist DESTINATION .. ) ENDIF(HDF5_PACK_MACOSX_BUNDLE) - ELSE (WIN32) + else (WIN32) LIST (APPEND CPACK_GENERATOR "STGZ") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") - SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") + set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") # LIST (APPEND CPACK_GENERATOR "RPM") - SET (CPACK_RPM_PACKAGE_RELEASE "1") - SET (CPACK_RPM_COMPONENT_INSTALL ON) - SET (CPACK_RPM_PACKAGE_RELOCATABLE ON) - SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style") - SET (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") - SET (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") - SET (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") - SET (CPACK_RPM_PACKAGE_DESCRIPTION + set (CPACK_RPM_PACKAGE_RELEASE "1") + set (CPACK_RPM_COMPONENT_INSTALL ON) + set (CPACK_RPM_PACKAGE_RELOCATABLE ON) + set (CPACK_RPM_PACKAGE_LICENSE "BSD-style") + set (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") + set (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") + set (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") + set (CPACK_RPM_PACKAGE_DESCRIPTION "The HDF5 technology suite includes: * A versatile data model that can represent very complex data objects and a wide variety of metadata. @@ -369,33 +369,33 @@ The HDF5 data model, file format, API, library, and tools are open and distribut # Configure the spec file for the install RPM #----------------------------------------------------------------------------- # CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) -# SET (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - ENDIF (WIN32) +# set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") + endif (WIN32) # By default, do not warn when built on machines using only VS Express: - IF (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) - SET (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) INCLUDE(InstallRequiredSystemLibraries) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") - IF (HDF5_PACKAGE_EXTLIBS) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_PACKAGE_EXTLIBS) + if (HDF5_PACKAGE_EXTLIBS) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (HDF5_PACKAGE_EXTLIBS) - INCLUDE (CPack) + include (CPack) #--------------------------------------------------------------------------- # Now list the cpack commands @@ -424,7 +424,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development ) - IF (HDF5_BUILD_FORTRAN) + if (HDF5_BUILD_FORTRAN) CPACK_ADD_COMPONENT (fortlibraries DISPLAY_NAME "HDF5 Fortran Libraries" DEPENDS libraries @@ -435,9 +435,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Development ) - ENDIF (HDF5_BUILD_FORTRAN) + endif (HDF5_BUILD_FORTRAN) - IF (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_CPP_LIB) CPACK_ADD_COMPONENT (cpplibraries DISPLAY_NAME "HDF5 C++ Libraries" DEPENDS libraries @@ -448,9 +448,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS cpplibraries GROUP Development ) - ENDIF (HDF5_BUILD_CPP_LIB) + endif (HDF5_BUILD_CPP_LIB) - IF (HDF5_BUILD_TOOLS) + if (HDF5_BUILD_TOOLS) CPACK_ADD_COMPONENT (toolsapplications DISPLAY_NAME "HDF5 Tools Applications" DEPENDS toolslibraries @@ -466,9 +466,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS toolslibraries GROUP Development ) - ENDIF (HDF5_BUILD_TOOLS) + endif (HDF5_BUILD_TOOLS) - IF (HDF5_BUILD_HL_LIB) + if (HDF5_BUILD_HL_LIB) CPACK_ADD_COMPONENT (hllibraries DISPLAY_NAME "HDF5 HL Libraries" DEPENDS libraries @@ -499,6 +499,6 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Runtime ) - ENDIF (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_HL_LIB) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) +endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4664942..e56e76e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ PROJECT (HDF5 C CXX) # HDF5_EXPORTED_TARGETS : # Set this to the name of the targets variable which controls exports # If unset (because parent project does not support/use the -# INSTALL (EXPORT target...) syntax), then targets are not configured +# install (EXPORT target...) syntax), then targets are not configured # for export during install. # # HDF5_LIB_DEPENDENCIES : @@ -44,25 +44,25 @@ PROJECT (HDF5 C CXX) # any project making use of this build of HDF5 will use the correct zlib # # # Tell hdf5 that we are manually overriding certain settings -# SET(HDF5_EXTERNALLY_CONFIGURED 1) +# set (HDF5_EXTERNALLY_CONFIGURED 1) # # Avoid duplicating names of installed libraries -# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk") +# set (HDF5_EXTERNAL_LIB_PREFIX "vtk") # # Export configuration to this export variable -# SET(HDF5_EXPORTED_TARGETS "paraview-targets") +# set (HDF5_EXPORTED_TARGETS "paraview-targets") # # # Setup all necessary overrides for zlib so that HDF5 uses our # # internally compiled zlib rather than any other version # IF(HDF5_ENABLE_Z_LIB_SUPPORT) # # We must tell the main HDF5 library that it depends on our zlib -# SET(HDF5_LIB_DEPENDENCIES vtkzlib) +# set (HDF5_LIB_DEPENDENCIES vtkzlib) # # Override the zlib header file # IF(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "zlib.h") +# set (H5_ZLIB_HEADER "zlib.h") # ELSE(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "vtk_zlib.h") +# set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project -# SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") -# SET(ZLIB_LIBRARIES vtkzlib) +# set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") +# set (ZLIB_LIBRARIES vtkzlib) # ENDIF(VTK_USE_SYSTEM_ZLIB) # ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) # @@ -77,281 +77,277 @@ PROJECT (HDF5 C CXX) # organization feature. Default to ON for non-Express users. Express users must # explicitly turn off this option to build HDF5 in the Express IDE... # -OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) MARK_AS_ADVANCED (HDF5_USE_FOLDERS) -IF (HDF5_USE_FOLDERS) - SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON) -ENDIF (HDF5_USE_FOLDERS) -OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) +if (HDF5_USE_FOLDERS) + set_property (GLOBAL PROPERTY USE_FOLDERS ON) +endif (HDF5_USE_FOLDERS) +option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) MARK_AS_ADVANCED (HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Set the core names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_CORENAME "hdf5") -SET (HDF5_TEST_LIB_CORENAME "hdf5_test") -SET (HDF5_CPP_LIB_CORENAME "hdf5_cpp") -SET (HDF5_HL_LIB_CORENAME "hdf5_hl") -SET (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") -SET (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") -SET (HDF5_F90_LIB_CORENAME "hdf5_fortran") -SET (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") -SET (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") -SET (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") -SET (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") -SET (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") +set (HDF5_LIB_CORENAME "hdf5") +set (HDF5_TEST_LIB_CORENAME "hdf5_test") +set (HDF5_CPP_LIB_CORENAME "hdf5_cpp") +set (HDF5_HL_LIB_CORENAME "hdf5_hl") +set (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") +set (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") +set (HDF5_F90_LIB_CORENAME "hdf5_fortran") +set (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") +set (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") +set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") +set (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") +set (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") #----------------------------------------------------------------------------- # Set the true names of all the libraries if customized by external project #----------------------------------------------------------------------------- -SET (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") -SET (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") -SET (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") -SET (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") -SET (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") -SET (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") -SET (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") -SET (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") -SET (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") -SET (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") -SET (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") -SET (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") +set (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") +set (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") +set (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") +set (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") +set (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") +set (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") +set (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") +set (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") +set (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") +set (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") +set (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") +set (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") #----------------------------------------------------------------------------- # Set the target names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) -SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) -SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) -SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) -SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) -SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) -SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) -SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) -SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) -SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) -SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) -SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) +set (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) +set (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) +set (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) +set (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) +set (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) +set (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) +set (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) +set (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) +set (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) +set (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) +set (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) +set (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- -SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) -SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) -SET (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) -SET (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) -SET (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) -SET (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) -SET (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) -SET (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) -SET (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) -SET (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) - -IF (NOT HDF5_INSTALL_BIN_DIR) - SET (HDF5_INSTALL_BIN_DIR bin) -ENDIF (NOT HDF5_INSTALL_BIN_DIR) -IF (NOT HDF5_INSTALL_LIB_DIR) - SET (HDF5_INSTALL_LIB_DIR lib) -ENDIF (NOT HDF5_INSTALL_LIB_DIR) -IF (NOT HDF5_INSTALL_INCLUDE_DIR) - SET (HDF5_INSTALL_INCLUDE_DIR include) -ENDIF (NOT HDF5_INSTALL_INCLUDE_DIR) -IF (NOT HDF5_INSTALL_DATA_DIR) - IF (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR share) - SET (HDF5_INSTALL_CMAKE_DIR share/cmake) - ELSE (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR ".") - SET (HDF5_INSTALL_CMAKE_DIR cmake) - ENDIF (NOT WIN32) -ENDIF (NOT HDF5_INSTALL_DATA_DIR) +set (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) +set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) +set (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) +set (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) +set (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) +set (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) +set (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) +set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) +set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) +set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) + +if (NOT HDF5_INSTALL_BIN_DIR) + set (HDF5_INSTALL_BIN_DIR bin) +endif (NOT HDF5_INSTALL_BIN_DIR) +if (NOT HDF5_INSTALL_LIB_DIR) + set (HDF5_INSTALL_LIB_DIR lib) +endif (NOT HDF5_INSTALL_LIB_DIR) +if (NOT HDF5_INSTALL_INCLUDE_DIR) + set (HDF5_INSTALL_INCLUDE_DIR include) +endif (NOT HDF5_INSTALL_INCLUDE_DIR) +if (NOT HDF5_INSTALL_DATA_DIR) + if (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR share) + set (HDF5_INSTALL_CMAKE_DIR share/cmake) + else (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR ".") + set (HDF5_INSTALL_CMAKE_DIR cmake) + endif (NOT WIN32) +endif (NOT HDF5_INSTALL_DATA_DIR) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MAJOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -#MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +#message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) -STRING (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) MATH(EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) -MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- # Basic HDF5 stuff here #----------------------------------------------------------------------------- -SET (HDF5_PACKAGE "hdf5") -SET (HDF5_PACKAGE_NAME "HDF5") -SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") -SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") -SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") -SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") -SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") -SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") -SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") +set (HDF5_PACKAGE "hdf5") +set (HDF5_PACKAGE_NAME "HDF5") +set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") +set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") +if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") +set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") +set (HDF5_PACKAGE_URL "http://www.hdfgroup.org") +set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") #----------------------------------------------------------------------------- # Set Install folder value #----------------------------------------------------------------------------- -IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) IF(CMAKE_HOST_UNIX) - SET(CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + set (CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) ELSE(CMAKE_HOST_UNIX) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) - SET(CMAKE_INSTALL_PREFIX + set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - SET(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_GENERIC_PROGRAM_FILES) ENDIF(CMAKE_HOST_UNIX) -ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY +if (NOT HDF5_EXTERNALLY_CONFIGURED) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." ) - SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" ) - SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." ) - SET (CMAKE_Fortran_MODULE_DIRECTORY + set (CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules." ) -ELSE (NOT HDF5_EXTERNALLY_CONFIGURED) +else (NOT HDF5_EXTERNALLY_CONFIGURED) # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail - IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - ENDIF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use # by other projects using FindHDF5. #----------------------------------------------------------------------------- -IF (NOT HDF5_EXPORTED_TARGETS) - SET (HDF5_EXPORTED_TARGETS "hdf5-targets") -ENDIF (NOT HDF5_EXPORTED_TARGETS) +if (NOT HDF5_EXPORTED_TARGETS) + set (HDF5_EXPORTED_TARGETS "hdf5-targets") +endif (NOT HDF5_EXPORTED_TARGETS) #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, # add it to this variable. This is NOT used by Make Install, but for projects # which include hdf5 as a sub-project within their build tree #----------------------------------------------------------------------------- -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "") -SET (EXTERNAL_HEADER_LIST "") -SET (EXTERNAL_LIBRARY_LIST "") -SET (EXTERNAL_LIBRARYDLL_LIST "") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "") +set (EXTERNAL_HEADER_LIST "") +set (EXTERNAL_LIBRARY_LIST "") +set (EXTERNAL_LIBRARYDLL_LIST "") #----------------------------------------------------------------------------- # Run all the CMake configuration tests for our build environment #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) +include (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) + +set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- # Option to Build Shared/Static libs, default is static #----------------------------------------------------------------------------- -OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) -SET (LIB_TYPE STATIC) -SET (H5_ENABLE_SHARED_LIB NO) -SET (H5_ENABLE_STATIC_LIB NO) -IF (BUILD_SHARED_LIBS) - SET (LIB_TYPE SHARED) - SET (H5_BUILT_AS_DYNAMIC_LIB 1) - SET (H5_ENABLE_SHARED_LIB YES) -ELSE (BUILD_SHARED_LIBS) - SET (H5_BUILT_AS_STATIC_LIB 1) - SET (H5_ENABLE_STATIC_LIB YES) - IF (NOT WIN32) - # should this be a user setting : Everyone uses it anyway ? - ADD_DEFINITIONS (-DPIC) - IF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ADD_DEFINITIONS (-KPIC) - ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ENDIF (NOT WIN32) -ENDIF (BUILD_SHARED_LIBS) +option (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +set (LIB_TYPE STATIC) +set (H5_ENABLE_SHARED_LIB NO) +set (H5_ENABLE_STATIC_LIB NO) +if (BUILD_SHARED_LIBS) + set (LIB_TYPE SHARED) + set (H5_BUILT_AS_DYNAMIC_LIB 1) + set (H5_ENABLE_SHARED_LIB YES) +else (BUILD_SHARED_LIBS) + set (H5_BUILT_AS_STATIC_LIB 1) + set (H5_ENABLE_STATIC_LIB YES) + set (CMAKE_POSITION_INDEPENDENT_CODE ON) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF) -IF (BUILD_STATIC_EXECS) - IF (NOT WIN32) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - ENDIF (NOT WIN32) -ENDIF (BUILD_STATIC_EXECS) +option (BUILD_STATIC_EXECS "Build Static Executabless" OFF) +if (BUILD_STATIC_EXECS) + if (NOT WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + endif (NOT WIN32) +endif (BUILD_STATIC_EXECS) #----------------------------------------------------------------------------- # Option to use code coverage #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) -IF (HDF5_ENABLE_COVERAGE) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -ENDIF (HDF5_ENABLE_COVERAGE) +option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) +if (HDF5_ENABLE_COVERAGE) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") +endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- # Option to indicate using dmalloc #----------------------------------------------------------------------------- -# OPTION (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) -# IF (HDF5_ENABLE_USING_DMALLOC) +# option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) +# if (HDF5_ENABLE_USING_DMALLOC) # FIND_PACKAGE (DMALLOC) -# SET (H5_HAVE_DMALLOC DMALLOC_FOUND) -# ENDIF (HDF5_ENABLE_USING_DMALLOC) +# set (H5_HAVE_DMALLOC DMALLOC_FOUND) +# endif (HDF5_ENABLE_USING_DMALLOC) #----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) -IF (HDF5_ENABLE_USING_MEMCHECKER) - SET (H5_USING_MEMCHECKER 1) -ENDIF (HDF5_ENABLE_USING_MEMCHECKER) +option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) +if (HDF5_ENABLE_USING_MEMCHECKER) + set (H5_USING_MEMCHECKER 1) +endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- # Option to use deprecated public API symbols #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 0) -ELSE (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 1) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 0) +else (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 1) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -359,296 +355,290 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) # Certain systems may add /Debug or /Release to output paths # and we need to call the executable from inside the CMake configuration #----------------------------------------------------------------------------- -SET (EXE_EXT "") -IF (WIN32) - SET (EXE_EXT ".exe") - IF (NOT CYGWIN) - ADD_DEFINITIONS (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ADD_DEFINITIONS (-D_CONSOLE) - ENDIF (NOT CYGWIN) -ENDIF (WIN32) - -IF (MSVC) - SET (CMAKE_MFC_FLAG 0) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "") -ENDIF (MSVC) - -SET (MAKE_SYSTEM) -IF (CMAKE_BUILD_TOOL MATCHES "make") - SET (MAKE_SYSTEM 1) -ENDIF (CMAKE_BUILD_TOOL MATCHES "make") - -SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") -IF (MAKE_SYSTEM) - SET (CFG_INIT "") -ENDIF (MAKE_SYSTEM) +set (EXE_EXT "") +if (WIN32) + set (EXE_EXT ".exe") + if (NOT CYGWIN) + add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + add_definitions (-D_CONSOLE) + endif (NOT CYGWIN) +endif (WIN32) + +if (MSVC) + set (CMAKE_MFC_FLAG 0) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "") +endif (MSVC) + +set (MAKE_SYSTEM) +if (CMAKE_BUILD_TOOL MATCHES "make") + set (MAKE_SYSTEM 1) +endif (CMAKE_BUILD_TOOL MATCHES "make") + +set (CFG_INIT "/${CMAKE_CFG_INTDIR}") +if (MAKE_SYSTEM) + set (CFG_INIT "") +endif (MAKE_SYSTEM) #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- -IF (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DDEBUG) - ADD_DEFINITIONS ( - -DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG - -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG - -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG - -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG - ) +if (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DDEBUG) # Enable tracing of the API - OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) - IF (HDF5_ENABLE_TRACE) - ADD_DEFINITIONS (-DH5_DEBUG_API ) - ENDIF (HDF5_ENABLE_TRACE) + option (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) + if (HDF5_ENABLE_TRACE) + add_definitions (-DH5_DEBUG_API ) + endif (HDF5_ENABLE_TRACE) # Enable instrumenting of the library's internal operations - OPTION (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) - IF (HDF5_ENABLE_INSTRUMENT) - SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) - ENDIF (HDF5_ENABLE_INSTRUMENT) + option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) + if (HDF5_ENABLE_INSTRUMENT) + set (H5_HAVE_INSTRUMENTED_LIBRARY 1) + endif (HDF5_ENABLE_INSTRUMENT) MARK_AS_ADVANCED (HDF5_Enable_Instrument) #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. - IF (NOT WIN32) - ADD_DEFINITIONS (-Wall) - ENDIF (NOT WIN32) -ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DNDEBUG) - OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) - IF (HDF5_ENABLE_TRACE) - ADD_DEFINITIONS (-DH5_DEBUG_API ) - ENDIF (HDF5_ENABLE_TRACE) -ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) + if (NOT WIN32) + add_definitions (-Wall) + endif (NOT WIN32) +else (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DNDEBUG) + option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) + if (HDF5_ENABLE_TRACE) + add_definitions (-DH5_DEBUG_API ) + endif (HDF5_ENABLE_TRACE) +endif (CMAKE_BUILD_TYPE MATCHES Debug) #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) -IF (HDF5_ENABLE_EMBEDDED_LIBINFO) - SET (H5_HAVE_EMBEDDED_LIBINFO 1) -ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) +option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) +if (HDF5_ENABLE_EMBEDDED_LIBINFO) + set (H5_HAVE_EMBEDDED_LIBINFO 1) +endif (HDF5_ENABLE_EMBEDDED_LIBINFO) #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings #----------------------------------------------------------------------------- -OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) -IF (HDF5_DISABLE_COMPILER_WARNINGS) +option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) +if (HDF5_DISABLE_COMPILER_WARNINGS) # MSVC uses /w to suppress warnings. It also complains if another # warning level is given, so remove it. - IF (MSVC) - SET (HDF5_WARNINGS_BLOCKED 1) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - ENDIF (MSVC) - IF (WIN32 AND NOT CYGWIN) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ENDIF (WIN32 AND NOT CYGWIN) + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + endif (MSVC) + if (WIN32 AND NOT CYGWIN) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif (WIN32 AND NOT CYGWIN) # Borland uses -w- to suppress warnings. - IF (BORLAND) - SET (HDF5_WARNINGS_BLOCKED 1) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - ENDIF (BORLAND) + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") + endif (BORLAND) # Most compilers use -w to suppress warnings. - IF (NOT HDF5_WARNINGS_BLOCKED) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - ENDIF (NOT HDF5_WARNINGS_BLOCKED) -ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif (NOT HDF5_WARNINGS_BLOCKED) +endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -IF (NOT MSVC) - IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - ELSE (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - ENDIF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +if (NOT MSVC) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") + else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") # Don't use the '-Wtraditional-conversion' flag, there's too many warnings # from GCC's assert macro - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") # Append warning flags from gcc-3* case # (don't use -Wpadded flag for normal builds, many of the warnings its # issuing can't be fixed and they are making it hard to detect other, # more important warnings) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") # The "unreachable code" warning appears to be reliable now... # (this warning was removed in gcc 4.5+) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") + #set (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") # Append warning flags from gcc-3.3* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") # Append more extra warning flags that only gcc 4.1+ know about - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") # Append more extra warning flags that only gcc 4.3+ know about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") # Append more extra warning flags that only gcc 4.6+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") # Append more extra warning flags that only gcc 4.7+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -ENDIF (NOT MSVC) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +endif (NOT MSVC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) -IF (HDF5_ENABLE_ALL_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_ALL_WARNINGS) +option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +if (HDF5_ENABLE_ALL_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (MSVC) +endif (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) -IF (HDF5_ENABLE_GROUPZERO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) +option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) +if (HDF5_ENABLE_GROUPZERO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (MSVC) +endif (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) -IF (HDF5_ENABLE_GROUPONE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) +option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +if (HDF5_ENABLE_GROUPONE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) -IF (HDF5_ENABLE_GROUPTWO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) +option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +if (HDF5_ENABLE_GROUPTWO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) -IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) +option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +if (HDF5_ENABLE_GROUPTHREE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) -IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) +option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +if (HDF5_ENABLE_GROUPFOUR_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) +option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +if (HDF5_ENABLE_GROUPFIVE_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories @@ -658,159 +648,159 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D #----------------------------------------------------------------------------- # Option to Enable MPI Parallel #----------------------------------------------------------------------------- -SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) -OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) -IF (HDF5_ENABLE_PARALLEL) - INCLUDE (FindMPI) +set (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) +option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +if (HDF5_ENABLE_PARALLEL) + include (FindMPI) INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) - IF (MPI_C_FOUND) - SET (H5_HAVE_PARALLEL 1) + if (MPI_C_FOUND) + set (H5_HAVE_PARALLEL 1) # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated - SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) + set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) - SET (H5_MPI_FILE_SET_SIZE_BIG 1) + set (H5_MPI_FILE_SET_SIZE_BIG 1) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - ELSE (MPI_C_FOUND) - MESSAGE (STATUS "Parallel libraries not found") - ENDIF (MPI_C_FOUND) -ENDIF (HDF5_ENABLE_PARALLEL) + else (MPI_C_FOUND) + message (STATUS "Parallel libraries not found") + endif (MPI_C_FOUND) +endif (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included -IF (H5_HAVE_PARALLEL) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) - IF (MPI_C_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - ENDIF (MPI_C_LINK_FLAGS) -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) + if (MPI_C_LINK_FLAGS) + set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") + endif (MPI_C_LINK_FLAGS) +endif (H5_HAVE_PARALLEL) -SET (DEFAULT_API_VERSION "v110") +set (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- # Option to use 1.6.x API #----------------------------------------------------------------------------- -OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) -SET (H5_USE_16_API_DEFAULT 0) -IF (HDF5_USE_16_API_DEFAULT) - SET (H5_USE_16_API_DEFAULT 1) - SET (DEFAULT_API_VERSION "v16") -ENDIF (HDF5_USE_16_API_DEFAULT) +option (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) +set (H5_USE_16_API_DEFAULT 0) +if (HDF5_USE_16_API_DEFAULT) + set (H5_USE_16_API_DEFAULT 1) + set (DEFAULT_API_VERSION "v16") +endif (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- # Option to use 1.8.x API #----------------------------------------------------------------------------- -OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) -SET (H5_USE_18_API_DEFAULT 0) -IF (HDF5_USE_18_API_DEFAULT) - SET (H5_USE_18_API_DEFAULT 1) - SET (DEFAULT_API_VERSION "v18") -ENDIF (HDF5_USE_18_API_DEFAULT) +option (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) +set (H5_USE_18_API_DEFAULT 0) +if (HDF5_USE_18_API_DEFAULT) + set (H5_USE_18_API_DEFAULT 1) + set (DEFAULT_API_VERSION "v18") +endif (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- # Include user macros #----------------------------------------------------------------------------- -INCLUDE (UserMacros.cmake) +include (UserMacros.cmake) -INCLUDE (CMakeFilters.cmake) +include (CMakeFilters.cmake) #----------------------------------------------------------------------------- # Option for external libraries on windows #----------------------------------------------------------------------------- -OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (HDF5_PACKAGE_EXTLIBS) - SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) +option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (HDF5_PACKAGE_EXTLIBS) + set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ENDIF (HDF5_PACKAGE_EXTLIBS) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + endif (HDF5_PACKAGE_EXTLIBS) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe # Note: Currently CMake only allows configuring of threadsafe on WINDOWS. #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) - IF (HDF5_ENABLE_THREADSAFE) +if (WIN32 AND NOT CYGWIN) + option (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) + if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") - ENDIF (HDF5_ENABLE_PARALLEL) - SET (H5_HAVE_THREADSAFE 1) - IF (H5_HAVE_IOEO) - MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") - SET (H5_HAVE_WIN_THREADS 1) - ELSE (H5_HAVE_IOEO) - IF (NOT H5_HAVE_PTHREAD_H) - SET (H5_HAVE_THREADSAFE 0) - MESSAGE (FATAL_ERROR " **** Threadsafe option requires thread library **** ") - ENDIF (NOT H5_HAVE_PTHREAD_H) - ENDIF (H5_HAVE_IOEO) - ENDIF (HDF5_ENABLE_THREADSAFE) -ENDIF (WIN32 AND NOT CYGWIN) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") + endif (HDF5_ENABLE_PARALLEL) + set (H5_HAVE_THREADSAFE 1) + if (H5_HAVE_IOEO) + message (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") + set (H5_HAVE_WIN_THREADS 1) + else (H5_HAVE_IOEO) + if (NOT H5_HAVE_PTHREAD_H) + set (H5_HAVE_THREADSAFE 0) + message (FATAL_ERROR " **** Threadsafe option requires thread library **** ") + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) + endif (HDF5_ENABLE_THREADSAFE) +endif (WIN32 AND NOT CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -#SET (CFLAGS "${C_DEFINES}") -#SET (CXXFLAGS "${CXX_DEFINES}") +#set (CFLAGS "${C_DEFINES}") +#set (CXXFLAGS "${CXX_DEFINES}") #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Dashboard and Testing Settings #----------------------------------------------------------------------------- -OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF) -IF (BUILD_TESTING) - SET (DART_TESTING_TIMEOUT 1200 +option (BUILD_TESTING "Build HDF5 Unit Testing" OFF) +if (BUILD_TESTING) + set (DART_TESTING_TIMEOUT 1200 CACHE INTEGER "Timeout in seconds for each test (default 1200=20minutes)" ) ENABLE_TESTING () - INCLUDE (CTest) - IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + include (CTest) + if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - IF (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") + endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + if (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) ENDIF(EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") - IF (H5_HAVE_PARALLEL) - IF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + if (H5_HAVE_PARALLEL) + if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - ENDIF (H5_HAVE_PARALLEL) - ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + endif (H5_HAVE_PARALLEL) + endif (NOT HDF5_EXTERNALLY_CONFIGURED) - OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) + option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) MARK_AS_ADVANCED (HDF5_TEST_VFD) - IF (HDF5_TEST_VFD) - OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) + if (HDF5_TEST_VFD) + option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) - INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -818,88 +808,88 @@ ENDIF (BUILD_TESTING) # so that fortran name mangling is detected before writing H5pubconf.h #----------------------------------------------------------------------------- # Set default name mangling : overridden by Fortran detection in fortran dir -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") -IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") - OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - IF (HDF5_BUILD_FORTRAN) - 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) - INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) - IF (HDF5_ENABLE_F2003) - IF (NOT FORTRAN_HAVE_ISO_C_BINDING) - SET (HDF5_ENABLE_F2003 OFF) - ENDIF (NOT FORTRAN_HAVE_ISO_C_BINDING) - ENDIF (HDF5_ENABLE_F2003) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") +if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) + if (HDF5_BUILD_FORTRAN) + 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) + include (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) + if (HDF5_ENABLE_F2003) + if (NOT FORTRAN_HAVE_ISO_C_BINDING) + set (HDF5_ENABLE_F2003 OFF) + endif (NOT FORTRAN_HAVE_ISO_C_BINDING) + endif (HDF5_ENABLE_F2003) # ----------------------------------------------------------------------- # wrapper script variables # -# SET (FCFLAGS "${Fortran_DEFINES}") +# set (FCFLAGS "${Fortran_DEFINES}") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) - IF (HDF5_BUILD_HL_LIB) - IF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + if (HDF5_BUILD_HL_LIB) + if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") - ENDIF (HDF5_BUILD_HL_LIB) - ENDIF (HDF5_BUILD_FORTRAN) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + endif (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_FORTRAN) +endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") #----------------------------------------------------------------------------- # Option to build examples #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") - OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) - IF (HDF5_BUILD_EXAMPLES) +if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) + if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - ENDIF (HDF5_BUILD_EXAMPLES) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + endif (HDF5_BUILD_EXAMPLES) +endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") - OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) - IF (HDF5_BUILD_CPP_LIB) +if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) + if (HDF5_BUILD_CPP_LIB) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") - ENDIF (HDF5_ENABLE_PARALLEL) - IF (CMAKE_NO_STD_NAMESPACE) - SET (H5_NO_STD 1) - ENDIF (CMAKE_NO_STD_NAMESPACE) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") + endif (HDF5_ENABLE_PARALLEL) + if (CMAKE_NO_STD_NAMESPACE) + set (H5_NO_STD 1) + endif (CMAKE_NO_STD_NAMESPACE) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) - ENDIF (HDF5_BUILD_CPP_LIB) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + endif (HDF5_BUILD_CPP_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") #----------------------------------------------------------------------------- # Option to build HDF5 Tools #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") - OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) - IF (HDF5_BUILD_TOOLS) +if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) + if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - ENDIF (HDF5_BUILD_TOOLS) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + endif (HDF5_BUILD_TOOLS) +endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") #----------------------------------------------------------------------------- # Option to build High Level API's #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") - OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) - IF (HDF5_BUILD_HL_LIB) - SET (H5_INCLUDE_HL 1) +if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) + if (HDF5_BUILD_HL_LIB) + set (H5_INCLUDE_HL 1) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - ENDIF (HDF5_BUILD_HL_LIB) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + endif (HDF5_BUILD_HL_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation #----------------------------------------------------------------------------- CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) -INCLUDE (CMakeInstallation.cmake) +include (CMakeInstallation.cmake) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 92bd300..0e00427 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -4,28 +4,28 @@ ## # The following are required to uses Dart and the Cdash dashboard ## ENABLE_TESTING() ## INCLUDE(CTest) -SET (CTEST_PROJECT_NAME "HDF5") -SET (CTEST_NIGHTLY_START_TIME "18:00:00 CST") +set (CTEST_PROJECT_NAME "HDF5") +set (CTEST_NIGHTLY_START_TIME "18:00:00 CST") -SET (CTEST_DROP_METHOD "http") -IF (CDASH_LOCAL) - SET (CTEST_DROP_SITE "72.36.68.252") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") -ELSE (CDASH_LOCAL) - SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") -ENDIF (CDASH_LOCAL) -SET (CTEST_DROP_SITE_CDASH TRUE) +set (CTEST_DROP_METHOD "http") +if (CDASH_LOCAL) + set (CTEST_DROP_SITE "72.36.68.252") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") +else (CDASH_LOCAL) + set (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") +endif (CDASH_LOCAL) +set (CTEST_DROP_SITE_CDASH TRUE) -SET (UPDATE_TYPE svn) -SET (VALGRIND_COMMAND "/usr/bin/valgrind") -SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") -SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +set (UPDATE_TYPE svn) +set (VALGRIND_COMMAND "/usr/bin/valgrind") +set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +set (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") +set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING +set (CTEST_TEST_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test.") -SET (DART_TESTING_TIMEOUT 3600 CACHE STRING +set (DART_TESTING_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING diff --git a/UserMacros.cmake b/UserMacros.cmake index 4c680ed..65ea5d4 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -8,14 +8,14 @@ # Option to Build with User Defined Values #----------------------------------------------------------------------------- MACRO (MACRO_USER_DEFINED_LIBS) - SET (USER_DEFINED_VALUE "FALSE") + set (USER_DEFINED_VALUE "FALSE") ENDMACRO (MACRO_USER_DEFINED_LIBS) #------------------------------------------------------------------------------- -OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) -IF (BUILD_USER_DEFINED_LIBS) +option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -ENDIF (BUILD_USER_DEFINED_LIBS) +endif (BUILD_USER_DEFINED_LIBS) #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index e3ad541..1150994 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -286,8 +286,8 @@ set($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -SET (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -SET (CTEST_CONFIGURE_COMMAND +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"") # Print summary information. diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 50ea838..9b560a6 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file @@ -31,23 +31,23 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) #----------------------------------------------------------------------------- # Parallel/MPI, prevent spurious cpp/cxx warnings #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL) - ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX") - ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK") -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif (H5_HAVE_PARALLEL) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index c79f6c2..b6b1afa 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -10,7 +10,7 @@ PROJECT (HDF5_CPP_EXAMPLES) # Define examples #----------------------------------------------------------------------------- -SET (examples +set (examples create readdata writedata @@ -20,7 +20,7 @@ SET (examples h5group ) -SET (tutr_examples +set (tutr_examples h5tutr_cmprss h5tutr_crtdat h5tutr_crtatt @@ -32,22 +32,22 @@ SET (tutr_examples h5tutr_subset ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${examples}) -FOREACH (example ${tutr_examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${tutr_examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${tutr_examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${tutr_examples}) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index b39dcfe..5725f8e 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -15,18 +15,18 @@ SDSextendible.h5 Select.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex-clear-objects") - FOREACH (example ${examples}) + foreach (example ${examples}) ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_readdata PROPERTIES DEPENDS cpp_ex_create) # SET_TESTS_PROPERTIES(cpp_ex_chunks PROPERTIES DEPENDS cpp_ex_extend_ds) @@ -42,18 +42,18 @@ h5tutr_groups.h5 h5tutr_subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_tutr-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_tutr-clear-objects") - FOREACH (example ${tutr_examples}) + foreach (example ${tutr_examples}) ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${tutr_examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${tutr_examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_crtatt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_rdwt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index af6283a..15eeacc 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -4,9 +4,9 @@ PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file @@ -18,7 +18,7 @@ CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in #----------------------------------------------------------------------------- # Define cpp Library #----------------------------------------------------------------------------- -SET (CPP_SRCS +set (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.cpp @@ -48,7 +48,7 @@ SET (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.cpp ) -SET (CPP_HDRS +set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Alltypes.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.h @@ -83,17 +83,17 @@ SET (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h ) -ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") +target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) +set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${CPP_HDRS} DESTINATION @@ -105,12 +105,12 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_CPP_LIB_TARGET} EXPORT @@ -119,4 +119,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index e498fc5..01a0179 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT (HDF5_CPP_TEST) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (CPP_TEST_SRCS +set (CPP_TEST_SRCS ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp @@ -29,27 +29,27 @@ SET (CPP_TEST_SRCS #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) -ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) +add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_testhdf5 " " " ") -TARGET_LINK_LIBRARIES (cpp_testhdf5 +target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) -SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET cpp_testhdf5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.h5 ${PROJECT_BINARY_DIR}/th5s.h5 ) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 3e4f6d9..ac1f111 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -20,9 +20,9 @@ ADD_TEST ( ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>) SET_TESTS_PROPERTIES (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -31,12 +31,12 @@ IF (HDF5_TEST_VFD) family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME VFD-${vfdname}-cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} @@ -60,12 +60,12 @@ IF (HDF5_TEST_VFD) -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) SET_TESTS_PROPERTIES (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index cb32827..6d3f0ee 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,6 +1,6 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) +set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) -SET (CTEST_CUSTOM_WARNING_EXCEPTION +set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" @@ -17,7 +17,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) -SET (CTEST_CUSTOM_MEMCHECK_IGNORE +set (CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} flush1 #designed to fail flush2 #designed to need flush1 diff --git a/config/cmake/CheckTypeSize.cmake b/config/cmake/CheckTypeSize.cmake index eca6e76..0fe2cbc 100644 --- a/config/cmake/CheckTypeSize.cmake +++ b/config/cmake/CheckTypeSize.cmake @@ -8,23 +8,23 @@ # MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) - IF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) - FOREACH (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) - IF ("${def}") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") + foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) + if ("${def}") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") ENDIF("${def}") - ENDFOREACH (def) + endforeach (def) - MESSAGE (STATUS "Check size of ${TYPE}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_TYPE_SIZE_ADD_LIBRARIES + message (STATUS "Check size of ${TYPE}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) TRY_RUN (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/CheckTypeSize.c @@ -32,17 +32,17 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - done") + if (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - done") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - ELSE (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - failed") + else (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - failed") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - ENDIF (HAVE_${VARIABLE}) - ENDIF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) + endif (HAVE_${VARIABLE}) + endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index f92bd0d..93c6138 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -1,68 +1,68 @@ #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- -INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) +include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) #----------------------------------------------------------------------------- # APPLE/Darwin setup #----------------------------------------------------------------------------- -IF (APPLE) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - IF(ARCH_LENGTH GREATER 1) +if (APPLE) + list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) + if (ARCH_LENGTH GREATER 1) set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" "due to technical reasons. The best approach would be build each architecture in separate directories" "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" "variable has been set to a blank value which will build the default architecture for this system.") - ENDIF() - SET (H5_AC_APPLE_UNIVERSAL_BUILD 0) -ENDIF (APPLE) + endif () + set (H5_AC_APPLE_UNIVERSAL_BUILD 0) +endif (APPLE) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET (H5_HAVE_DARWIN 1) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set (H5_HAVE_DARWIN 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Check for Solaris -IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (H5_HAVE_SOLARIS 1) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (H5_HAVE_SOLARIS 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") #----------------------------------------------------------------------------- # Option to Clear File Buffers before write --enable-clear-file-buffers #----------------------------------------------------------------------------- -OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) -IF (HDF5_Enable_Clear_File_Buffers) - SET (H5_CLEAR_MEMORY 1) -ENDIF (HDF5_Enable_Clear_File_Buffers) +option (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) +if (HDF5_Enable_Clear_File_Buffers) + set (H5_CLEAR_MEMORY 1) +endif (HDF5_Enable_Clear_File_Buffers) MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- -OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) -IF (HDF5_STRICT_FORMAT_CHECKS) - SET (H5_STRICT_FORMAT_CHECKS 1) -ENDIF (HDF5_STRICT_FORMAT_CHECKS) +option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +if (HDF5_STRICT_FORMAT_CHECKS) + set (H5_STRICT_FORMAT_CHECKS 1) +endif (HDF5_STRICT_FORMAT_CHECKS) MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- # Option for --enable-metadata-trace-file #----------------------------------------------------------------------------- -OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) -IF (HDF5_METADATA_TRACE_FILE) - SET (H5_METADATA_TRACE_FILE 1) -ENDIF (HDF5_METADATA_TRACE_FILE) +option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) +if (HDF5_METADATA_TRACE_FILE) + set (H5_METADATA_TRACE_FILE 1) +endif (HDF5_METADATA_TRACE_FILE) MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # ---------------------------------------------------------------------- @@ -71,10 +71,10 @@ MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # though the data may be wrong (for example, some compilers don't # support denormalized floating values) to maximize speed. # -OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) -IF (HDF5_WANT_DATA_ACCURACY) - SET (H5_WANT_DATA_ACCURACY 1) -ENDIF(HDF5_WANT_DATA_ACCURACY) +option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +if (HDF5_WANT_DATA_ACCURACY) + set (H5_WANT_DATA_ACCURACY 1) +endif (HDF5_WANT_DATA_ACCURACY) MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # ---------------------------------------------------------------------- @@ -83,199 +83,199 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # for the speed optimization of hard conversions. Soft conversions can # actually benefit little. # -OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) -IF (HDF5_WANT_DCONV_EXCEPTION) - SET (H5_WANT_DCONV_EXCEPTION 1) -ENDIF (HDF5_WANT_DCONV_EXCEPTION) +option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +if (HDF5_WANT_DCONV_EXCEPTION) + set (H5_WANT_DCONV_EXCEPTION 1) +endif (HDF5_WANT_DCONV_EXCEPTION) MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # ---------------------------------------------------------------------- # Check if they would like the function stack support compiled in # -OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) -IF (HDF5_ENABLE_CODESTACK) - SET (H5_HAVE_CODESTACK 1) -ENDIF (HDF5_ENABLE_CODESTACK) +option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +if (HDF5_ENABLE_CODESTACK) + set (H5_HAVE_CODESTACK 1) +endif (HDF5_ENABLE_CODESTACK) MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) -OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) +option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting # floating-point to long long values. # (This flag should be _unset_ for all machines) # -# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) +# set (H5_HW_FP_TO_LLONG_NOT_WORKS 0) # so far we have no check for this -SET(H5_HAVE_TMPFILE 1) +set (H5_HAVE_TMPFILE 1) #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it # does, it appends library to the list. #----------------------------------------------------------------------------- -SET (LINK_LIBS "") +set (LINK_LIBS "") MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) - IF (${VARIABLE}) - SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + endif (${VARIABLE}) ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) # ---------------------------------------------------------------------- # WINDOWS Hard code Values # ---------------------------------------------------------------------- -SET (WINDOWS) -IF (WIN32) - IF (MINGW) - SET (H5_HAVE_MINGW 1) - SET (WINDOWS 1) # MinGW tries to imitate Windows - SET (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - ENDIF (MINGW) - SET (H5_HAVE_WIN32_API 1) - SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (WINDOWS 1) - SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") - IF (MSVC) - SET (H5_HAVE_VISUAL_STUDIO 1) - ENDIF (MSVC) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) -ENDIF (WIN32) - -#IF (WIN32) -# SET (DEFAULT_STREAM_VFD OFF) -#ELSE (WIN32) -# SET (DEFAULT_STREAM_VFD ON) -#ENDIF (WIN32) -#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) +set (WINDOWS) +if (WIN32) + if (MINGW) + set (H5_HAVE_MINGW 1) + set (WINDOWS 1) # MinGW tries to imitate Windows + set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") + endif (MINGW) + set (H5_HAVE_WIN32_API 1) + set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (WINDOWS 1) + set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") + if (MSVC) + set (H5_HAVE_VISUAL_STUDIO 1) + endif (MSVC) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) +endif (WIN32) + +#if (WIN32) +# set (DEFAULT_STREAM_VFD OFF) +#else (WIN32) +# set (DEFAULT_STREAM_VFD ON) +#endif (WIN32) +#option (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) # TODO -------------------------------------------------------------------------- # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure # -SET (H5_DEFAULT_VFD H5FD_SEC2) - -IF (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - IF (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") - ELSE (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") - ENDIF (WINDOWS) -ENDIF (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - -IF (WINDOWS) - SET (H5_HAVE_WINDOWS 1) +set (H5_DEFAULT_VFD H5FD_SEC2) + +if (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + if (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") + else (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") + endif (WINDOWS) +endif (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + +if (WINDOWS) + set (H5_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine has window style pathname, # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) - SET (H5_HAVE_WINDOW_PATH 1) -ENDIF (WINDOWS) - -IF (WINDOWS) - SET (H5_HAVE_STDDEF_H 1) - SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_LIBM 1) - SET (H5_HAVE_STRDUP 1) - SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_LONGJMP 1) - IF (NOT MINGW) - SET (H5_HAVE_GETHOSTNAME 1) - ENDIF (NOT MINGW) - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_FUNCTION 1) - SET (H5_GETTIMEOFDAY_GIVES_TZ 1) - SET (H5_HAVE_TIMEZONE 1) - SET (H5_HAVE_GETTIMEOFDAY 1) - SET (H5_LONE_COLON 0) - IF (MINGW) - SET (H5_HAVE_WINSOCK2_H 1) - ENDIF (MINGW) - SET (H5_HAVE_LIBWS2_32 1) - SET (H5_HAVE_LIBWSOCK32 1) + set (H5_HAVE_WINDOW_PATH 1) +endif (WINDOWS) + +if (WINDOWS) + set (H5_HAVE_STDDEF_H 1) + set (H5_HAVE_SYS_STAT_H 1) + set (H5_HAVE_SYS_TYPES_H 1) + set (H5_HAVE_LIBM 1) + set (H5_HAVE_STRDUP 1) + set (H5_HAVE_SYSTEM 1) + set (H5_HAVE_LONGJMP 1) + if (NOT MINGW) + set (H5_HAVE_GETHOSTNAME 1) + endif (NOT MINGW) + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_FUNCTION 1) + set (H5_GETTIMEOFDAY_GIVES_TZ 1) + set (H5_HAVE_TIMEZONE 1) + set (H5_HAVE_GETTIMEOFDAY 1) + set (H5_LONE_COLON 0) + if (MINGW) + set (H5_HAVE_WINSOCK2_H 1) + endif (MINGW) + set (H5_HAVE_LIBWS2_32 1) + set (H5_HAVE_LIBWSOCK32 1) #----------------------------------------------------------------------------- # These tests need to be manually SET for windows since there is currently # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) + set (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +endif (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- -IF (CYGWIN) - SET (H5_HAVE_LSEEK64 0) -ENDIF (CYGWIN) +if (CYGWIN) + set (H5_HAVE_LSEEK64 0) +endif (CYGWIN) #----------------------------------------------------------------------------- # Check for the math library "m" #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) -ENDIF (NOT WINDOWS) +endif (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) -IF (NOT NOT_NEED_LIBNSL) +if (NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) -ENDIF (NOT NOT_NEED_LIBNSL) +endif (NOT NOT_NEED_LIBNSL) # For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) +set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) -SET (USE_INCLUDES "") -IF (WINDOWS) - SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") -ENDIF (WINDOWS) +set (USE_INCLUDES "") +if (WINDOWS) + set (USE_INCLUDES ${USE_INCLUDES} "windows.h") +endif (WINDOWS) -IF (NOT WINDOWS) - TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) -ENDIF (NOT WINDOWS) +if (NOT WINDOWS) + TEST_BIG_ENDIAN (H5_WORDS_BIGENDIAN) +endif (NOT WINDOWS) # For other specific tests, use this MACRO. MACRO (HDF5_FUNCTION_TEST OTHER_TEST) - IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - SET (OTHER_TEST_ADD_LIBRARIES) - IF (CMAKE_REQUIRED_LIBRARIES) - SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ENDIF (CMAKE_REQUIRED_LIBRARIES) - - FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - ENDFOREACH (def) - - FOREACH (def + if ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H ) - IF ("${H5_${def}}") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - ENDIF ("${H5_${def}}") - ENDFOREACH (def) + if ("${H5_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${H5_${def}}") + endforeach (def) - IF (LARGEFILE) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5Tests.c @@ -283,18 +283,18 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (${OTHER_TEST}) - SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") - ELSE (${OTHER_TEST}) - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") - SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + if (${OTHER_TEST}) + set (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + else (${OTHER_TEST}) + message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + set (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF (${OTHER_TEST}) - ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + endif (${OTHER_TEST}) + endif ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") ENDMACRO (HDF5_FUNCTION_TEST) #----------------------------------------------------------------------------- @@ -306,58 +306,58 @@ CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) #CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) # Since gettimeofday is not defined any where standard, lets look in all the # usual places. On MSVC we are just going to use ::clock() -IF (NOT MSVC) - IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") +if (NOT MSVC) + if ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp COMPILE_DEFINITIONS -DTRY_TIME_H OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + if (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + set (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") + set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + endif (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + endif ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + if ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp COMPILE_DEFINITIONS -DTRY_SYS_TIME_H OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - - IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) - MESSAGE (STATUS "---------------------------------------------------------------") - MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") - MESSAGE (STATUS " own implementation.. This can happen on older versions of") - MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") - MESSAGE (STATUS " to a newer version such as MinGW 3.12") - MESSAGE (STATUS "---------------------------------------------------------------") - ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) -ENDIF (NOT MSVC) + if (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + set (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") + set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + endif (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + endif ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + + if (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) + message (STATUS "---------------------------------------------------------------") + message (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") + message (STATUS " own implementation.. This can happen on older versions of") + message (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") + message (STATUS " to a newer version such as MinGW 3.12") + message (STATUS "---------------------------------------------------------------") + endif (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) +endif (NOT MSVC) # Find the library containing clock_gettime() -IF (NOT WINDOWS) +if (NOT WINDOWS) CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) - IF(CLOCK_GETTIME_IN_LIBC) - SET(H5_HAVE_CLOCK_GETTIME 1) - ELSEIF(CLOCK_GETTIME_IN_LIBRT) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS rt) - ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS posix4) - ENDIF(CLOCK_GETTIME_IN_LIBC) -ENDIF (NOT WINDOWS) + if (CLOCK_GETTIME_IN_LIBC) + set (H5_HAVE_CLOCK_GETTIME 1) + elseif (CLOCK_GETTIME_IN_LIBRT) + set (H5_HAVE_CLOCK_GETTIME 1) + list (APPEND LINK_LIBS rt) + elseif (CLOCK_GETTIME_IN_LIBPOSIX4) + set (H5_HAVE_CLOCK_GETTIME 1) + list (APPEND LINK_LIBS posix4) + endif (CLOCK_GETTIME_IN_LIBC) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -365,9 +365,9 @@ ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) - IF (${VARIABLE}) - SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + endif (${VARIABLE}) ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- @@ -389,31 +389,31 @@ CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler # has been initialized (e.g. the project also includes some c++) -IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) +if (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) - IF (NOT H5_HAVE_STDINT_H_CXX) - SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") - SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - ENDIF (NOT H5_HAVE_STDINT_H_CXX) -ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + if (NOT H5_HAVE_STDINT_H_CXX) + set (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + endif (NOT H5_HAVE_STDINT_H_CXX) +endif (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) -IF (NOT CYGWIN) +if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK2_H) -ENDIF (NOT CYGWIN) +endif (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) -IF (CMAKE_SYSTEM_NAME MATCHES "OSF") +if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) -ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") - SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) - SET (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") +else (CMAKE_SYSTEM_NAME MATCHES "OSF") + set (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + set (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +endif (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) @@ -433,12 +433,12 @@ CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) #----------------------------------------------------------------------------- # The linux-lfs option is deprecated. -SET (LINUX_LFS 0) +set (LINUX_LFS 0) -SET (HDF5_EXTRA_C_FLAGS) -SET (HDF5_EXTRA_FLAGS) -IF (NOT WINDOWS) - IF(NOT H5_HAVE_SOLARIS) +set (HDF5_EXTRA_C_FLAGS) +set (HDF5_EXTRA_FLAGS) +if (NOT WINDOWS) + if (NOT H5_HAVE_SOLARIS) # Linux Specific flags # This was originally defined as _POSIX_SOURCE which was updated to # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX @@ -446,93 +446,93 @@ IF (NOT WINDOWS) # correctly. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - SET (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) - SET (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) + set (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) + set (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) - OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) - IF (HDF5_ENABLE_LARGE_FILE) - SET (msg "Performing TEST_LFS_WORKS") + option (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + if (HDF5_ENABLE_LARGE_FILE) + set (msg "Performing TEST_LFS_WORKS") TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS OUTPUT_VARIABLE OUTPUT ) - IF (TEST_LFS_WORKS_COMPILE) - IF (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) - SET (LARGEFILE 1) - SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - MESSAGE (STATUS "${msg}... yes") - ELSE (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (TEST_LFS_WORKS_COMPILE) + if (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) + set (LARGEFILE 1) + set (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + message (STATUS "${msg}... yes") + else (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_RUN MATCHES 0) - ELSE (TEST_LFS_WORKS_COMPILE ) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (TEST_LFS_WORKS_RUN MATCHES 0) + else (TEST_LFS_WORKS_COMPILE ) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_COMPILE) - ENDIF (HDF5_ENABLE_LARGE_FILE) - SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) - ENDIF(NOT H5_HAVE_SOLARIS) -ENDIF (NOT WINDOWS) + endif (TEST_LFS_WORKS_COMPILE) + endif (HDF5_ENABLE_LARGE_FILE) + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) + endif (NOT H5_HAVE_SOLARIS) +endif (NOT WINDOWS) -ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) +add_definitions (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- # Check for HAVE_OFF64_T functionality #----------------------------------------------------------------------------- -IF (NOT WINDOWS OR MINGW) +if (NOT WINDOWS OR MINGW) HDF5_FUNCTION_TEST (HAVE_OFF64_T) - IF (H5_HAVE_OFF64_T) + if (H5_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) CHECK_FUNCTION_EXISTS (ftruncate64 H5_HAVE_FTRUNCATE64) - ENDIF (H5_HAVE_OFF64_T) + endif (H5_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) HDF5_FUNCTION_TEST (HAVE_STAT64_STRUCT) - IF (HAVE_STAT64_STRUCT) + if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) - ENDIF (HAVE_STAT64_STRUCT) -ENDIF (NOT WINDOWS OR MINGW) + endif (HAVE_STAT64_STRUCT) +endif (NOT WINDOWS OR MINGW) #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) - SET (aType ${type}) - SET (aVar ${var}) -# MESSAGE (STATUS "Checking size of ${aType} and storing into ${aVar}") + set (aType ${type}) + set (aVar ${var}) +# message (STATUS "Checking size of ${aType} and storing into ${aVar}") CHECK_TYPE_SIZE (${aType} ${aVar}) - IF (NOT ${aVar}) - SET (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# MESSAGE (STATUS "Size of ${aType} was NOT Found") - ENDIF (NOT ${aVar}) + if (NOT ${aVar}) + set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") +# message (STATUS "Size of ${aType} was NOT Found") + endif (NOT ${aVar}) ENDMACRO (H5_CHECK_TYPE_SIZE) H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) H5_CHECK_TYPE_SIZE (unsigned H5_SIZEOF_UNSIGNED) -IF (NOT APPLE) +if (NOT APPLE) H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) -ENDIF (NOT APPLE) +endif (NOT APPLE) H5_CHECK_TYPE_SIZE ("long long" H5_SIZEOF_LONG_LONG) H5_CHECK_TYPE_SIZE (__int64 H5_SIZEOF___INT64) -IF (NOT H5_SIZEOF___INT64) - SET (H5_SIZEOF___INT64 0) -ENDIF (NOT H5_SIZEOF___INT64) +if (NOT H5_SIZEOF___INT64) + set (H5_SIZEOF___INT64 0) +endif (NOT H5_SIZEOF___INT64) H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) @@ -566,24 +566,24 @@ H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) -IF (NOT APPLE) +if (NOT APPLE) H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) - IF (NOT H5_SIZEOF_SSIZE_T) - SET (H5_SIZEOF_SSIZE_T 0) - ENDIF (NOT H5_SIZEOF_SSIZE_T) - IF (NOT WINDOWS) + if (NOT H5_SIZEOF_SSIZE_T) + set (H5_SIZEOF_SSIZE_T 0) + endif (NOT H5_SIZEOF_SSIZE_T) + if (NOT WINDOWS) H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) - ENDIF (NOT WINDOWS) -ENDIF (NOT APPLE) + endif (NOT WINDOWS) +endif (NOT APPLE) H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) -IF (NOT H5_SIZEOF_OFF64_T) - SET (H5_SIZEOF_OFF64_T 0) -ENDIF (NOT H5_SIZEOF_OFF64_T) +if (NOT H5_SIZEOF_OFF64_T) + set (H5_SIZEOF_OFF64_T 0) +endif (NOT H5_SIZEOF_OFF64_T) -IF (NOT WINDOWS) +if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type #----------------------------------------------------------------------------- @@ -598,7 +598,7 @@ IF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- - FOREACH (test + foreach (test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -609,11 +609,11 @@ IF (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) - IF (NOT CYGWIN AND NOT MINGW) + endforeach (test) + if (NOT CYGWIN AND NOT MINGW) HDF5_FUNCTION_TEST (HAVE_TIMEZONE) # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - ENDIF (NOT CYGWIN AND NOT MINGW) + endif (NOT CYGWIN AND NOT MINGW) # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -629,12 +629,12 @@ IF (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) - IF (NOT CYGWIN AND NOT MINGW) + if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) - ENDIF (NOT CYGWIN AND NOT MINGW) + endif (NOT CYGWIN AND NOT MINGW) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) -ENDIF (NOT WINDOWS) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used @@ -673,23 +673,23 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -IF (NOT WINDOWS) - IF (H5_HAVE_VSNPRINTF) +if (NOT WINDOWS) + if (H5_HAVE_VSNPRINTF) HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) - ENDIF (H5_HAVE_VSNPRINTF) -ENDIF (NOT WINDOWS) + endif (H5_HAVE_VSNPRINTF) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro #----------------------------------------------------------------------------- -IF (NOT H5_HAVE_SIGSETJMP) - IF (H5_HAVE_SETJMP_H) +if (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_SETJMP_H) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) - IF (H5_HAVE_MACRO_SIGSETJMP) - SET (H5_HAVE_SIGSETJMP 1) - ENDIF (H5_HAVE_MACRO_SIGSETJMP) - ENDIF (H5_HAVE_SETJMP_H) -ENDIF (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_MACRO_SIGSETJMP) + set (H5_HAVE_SIGSETJMP 1) + endif (H5_HAVE_MACRO_SIGSETJMP) + endif (H5_HAVE_SETJMP_H) +endif (NOT H5_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- # Check for Symbols @@ -698,8 +698,8 @@ CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) #----------------------------------------------------------------------------- # Check a bunch of other functions #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - FOREACH (test +if (NOT WINDOWS) + foreach (test LONE_COLON HAVE_ATTRIBUTE HAVE_C99_FUNC @@ -710,40 +710,40 @@ IF (NOT WINDOWS) CXX_HAVE_OFFSETOF ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (NOT WINDOWS) + endforeach (test) +endif (NOT WINDOWS) # For other CXX specific tests, use this MACRO. MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) - IF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - SET (OTHER_TEST_ADD_LIBRARIES) - IF (CMAKE_REQUIRED_LIBRARIES) - SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ENDIF (CMAKE_REQUIRED_LIBRARIES) - - FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - ENDFOREACH (def) - - FOREACH (def + if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H ) - IF ("${H5_${def}}") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - ENDIF ("${H5_${def}}") - ENDFOREACH (def) + if ("${H5_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${H5_${def}}") + endforeach (def) - IF (LARGEFILE) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp @@ -751,25 +751,25 @@ MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF ("${OTHER_TEST}" EQUAL 0) - SET (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - ELSE ("${OTHER_TEST}" EQUAL 0) - MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") - SET (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") + if ("${OTHER_TEST}" EQUAL 0) + set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + else ("${OTHER_TEST}" EQUAL 0) + message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF ("${OTHER_TEST}" EQUAL 0) - ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + endif ("${OTHER_TEST}" EQUAL 0) + endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") ENDMACRO (HDF5_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check a bunch of cxx functions #----------------------------------------------------------------------------- -IF (CMAKE_CXX_COMPILER_LOADED) - FOREACH (test +if (CMAKE_CXX_COMPILER_LOADED) + foreach (test OLD_HEADER_FILENAME H5_NO_NAMESPACE H5_NO_STD @@ -777,81 +777,81 @@ IF (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST ) HDF5_CXX_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (CMAKE_CXX_COMPILER_LOADED) + endforeach (test) +endif (CMAKE_CXX_COMPILER_LOADED) #----------------------------------------------------------------------------- # Check if Direct I/O driver works #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - OPTION (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) - IF (HDF5_ENABLE_DIRECT_VFD) - SET (msg "Performing TEST_DIRECT_VFD_WORKS") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") +if (NOT WINDOWS) + option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + if (HDF5_ENABLE_DIRECT_VFD) + set (msg "Performing TEST_DIRECT_VFD_WORKS") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} OUTPUT_VARIABLE OUTPUT ) - IF (TEST_DIRECT_VFD_WORKS_COMPILE) - IF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + if (TEST_DIRECT_VFD_WORKS_COMPILE) + if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) HDF5_FUNCTION_TEST (HAVE_DIRECT) - SET (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") - ADD_DEFINITIONS ("-D_GNU_SOURCE") - ELSE (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) - SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") + add_definitions ("-D_GNU_SOURCE") + else (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) - ELSE (TEST_DIRECT_VFD_WORKS_COMPILE ) - SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + else (TEST_DIRECT_VFD_WORKS_COMPILE ) + set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (TEST_DIRECT_VFD_WORKS_COMPILE) - ENDIF (HDF5_ENABLE_DIRECT_VFD) -ENDIF (NOT WINDOWS) + endif (TEST_DIRECT_VFD_WORKS_COMPILE) + endif (HDF5_ENABLE_DIRECT_VFD) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for the Stream VFD driver #----------------------------------------------------------------------------- -IF (HDF5_STREAM_VFD) +if (HDF5_STREAM_VFD) CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) - SET (H5_HAVE_STREAM 1) -ENDIF (HDF5_STREAM_VFD) + set (H5_HAVE_STREAM 1) +endif (HDF5_STREAM_VFD) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- -IF (WINDOWS) - IF (NOT HDF5_NO_IOEO_TEST) - MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") - IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - IF (LARGEFILE) - SET (CMAKE_REQUIRED_DEFINITIONS +if (WINDOWS) + if (NOT HDF5_NO_IOEO_TEST) + message (STATUS "Checking for InitOnceExecuteOnce:") + if ("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + if (LARGEFILE) + set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + endif (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") - IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - ENDIF(CMAKE_REQUIRED_LIBRARIES) - IF(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + if (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - ELSE(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - ENDIF(CMAKE_REQUIRED_INCLUDES) + else (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif (CMAKE_REQUIRED_INCLUDES) TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -863,108 +863,108 @@ IF (WINDOWS) "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" COMPILE_OUTPUT_VARIABLE OUTPUT) # if it did not compile make the return value fail code of 1 - IF(NOT HAVE_IOEO_COMPILED) - SET(HAVE_IOEO_EXITCODE 1) - ENDIF(NOT HAVE_IOEO_COMPILED) + if (NOT HAVE_IOEO_COMPILED) + set (HAVE_IOEO_EXITCODE 1) + endif (NOT HAVE_IOEO_COMPILED) # if the return value was 0 then it worked - IF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - SET(H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + set (H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") + message (STATUS "Performing Test InitOnceExecuteOnce - Success") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - ELSE("${HAVE_IOEO_EXITCODE}" EQUAL 0) - IF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - ELSE(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - ENDIF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Failed") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") + else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") + endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + + message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - ENDIF (NOT HDF5_NO_IOEO_TEST) -ENDIF (WINDOWS) + endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + endif ("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + endif (NOT HDF5_NO_IOEO_TEST) +endif (WINDOWS) #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) -IF (HDF5_ENABLE_GPFS) +option (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) +if (HDF5_ENABLE_GPFS) CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) - IF (HAVE_GPFS) + if (HAVE_GPFS) HDF5_FUNCTION_TEST (HAVE_GPFS) - ENDIF (HAVE_GPFS) -ENDIF (HDF5_ENABLE_GPFS) + endif (HAVE_GPFS) +endif (HDF5_ENABLE_GPFS) MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) #----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- -SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) -FOREACH (inline_test inline __inline__ __inline) - SET (INLINE_TEST_INLINE ${inline_test}) +set (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) +foreach (inline_test inline __inline__ __inline) + set (INLINE_TEST_INLINE ${inline_test}) HDF5_FUNCTION_TEST (INLINE_TEST_${inline_test}) -ENDFOREACH (inline_test) - -SET (HDF5_EXTRA_TEST_DEFINITIONS) -IF (INLINE_TEST___inline__) - SET (H5_inline __inline__) -ELSE (INLINE_TEST___inline__) - IF (INLINE_TEST___inline) - SET (H5_inline __inline) - ELSE (INLINE_TEST___inline) - IF (INLINE_TEST_inline) - SET (H5_inline inline) - ENDIF (INLINE_TEST_inline) - ENDIF (INLINE_TEST___inline) -ENDIF (INLINE_TEST___inline__) +endforeach (inline_test) + +set (HDF5_EXTRA_TEST_DEFINITIONS) +if (INLINE_TEST___inline__) + set (H5_inline __inline__) +else (INLINE_TEST___inline__) + if (INLINE_TEST___inline) + set (H5_inline __inline) + else (INLINE_TEST___inline) + if (INLINE_TEST_inline) + set (H5_inline inline) + endif (INLINE_TEST_inline) + endif (INLINE_TEST___inline) +endif (INLINE_TEST___inline__) #----------------------------------------------------------------------------- # Check how to print a Long Long integer #----------------------------------------------------------------------------- -IF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") - SET (PRINT_LL_FOUND 0) - MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") - FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) - SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") - IF (H5_SIZEOF_LONG_LONG) - SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - ENDIF (H5_SIZEOF_LONG_LONG) +if (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + set (PRINT_LL_FOUND 0) + message (STATUS "Checking for appropriate format for 64 bit long:") + foreach (HDF5_PRINTF_LL l64 l L q I64 ll) + set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + if (H5_SIZEOF_LONG_LONG) + set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + endif (H5_SIZEOF_LONG_LONG) TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} OUTPUT_VARIABLE OUTPUT ) - IF (HDF5_PRINTF_LL_TEST_COMPILE) - IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") - SET (PRINT_LL_FOUND 1) - ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") - ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - ELSE (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + set (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + set (PRINT_LL_FOUND 1) + else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + else (HDF5_PRINTF_LL_TEST_COMPILE) FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) - ENDFOREACH (HDF5_PRINTF_LL) - - IF (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") - ELSE (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") - SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + endif (HDF5_PRINTF_LL_TEST_COMPILE) + endforeach (HDF5_PRINTF_LL) + + if (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") + else (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: not found") + set (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - ENDIF (PRINT_LL_FOUND) -ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + endif (PRINT_LL_FOUND) +endif (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting @@ -972,62 +972,62 @@ ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # (This flag should be set for all machines, except for the Crays, where # the cache value is set in it's config file) # -SET (H5_CONVERT_DENORMAL_FLOAT 1) +set (H5_CONVERT_DENORMAL_FLOAT 1) #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_HSIZET) - SET (H5_HAVE_LARGE_HSIZET 1) -ENDIF (HDF5_ENABLE_HSIZET) +if (HDF5_ENABLE_HSIZET) + set (H5_HAVE_LARGE_HSIZET 1) +endif (HDF5_ENABLE_HSIZET) #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- MACRO (H5ConversionTests TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - # MESSAGE (STATUS "===> ${TEST}") + if ("${TEST}" MATCHES "^${TEST}$") + # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/ConversionTests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST OUTPUT_VARIABLE OUTPUT ) - IF (${TEST}_COMPILE) - IF (${TEST}_RUN MATCHES 0) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${TEST}_RUN MATCHES 0) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (${TEST}_COMPILE) + if (${TEST}_RUN MATCHES 0) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${TEST}_RUN MATCHES 0) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_RUN MATCHES 0) - ELSE (${TEST}_COMPILE ) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (${TEST}_RUN MATCHES 0) + else (${TEST}_COMPILE ) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_COMPILE) + endif (${TEST}_COMPILE) - ENDIF("${TEST}" MATCHES "^${TEST}$") + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5ConversionTests) #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- MACRO (H5MiscConversionTest VAR TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - IF (${VAR}) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${VAR}) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") - ENDIF (${VAR}) - ENDIF ("${TEST}" MATCHES "^${TEST}$") + if ("${TEST}" MATCHES "^${TEST}$") + if (${VAR}) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${VAR}) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") + endif (${VAR}) + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5MiscConversionTest) #----------------------------------------------------------------------------- @@ -1050,9 +1050,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # integers except 'unsigned long long'. Other HP-UX systems are unknown # yet. (1/8/05 - SLU) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from # integers to long double. (This flag should be set "yes" for all @@ -1078,11 +1078,11 @@ H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting # 64-bit machines, where the short program below tests if round-up is # correctly handled. # -IF (CMAKE_SYSTEM MATCHES "solaris2.*") +if (CMAKE_SYSTEM MATCHES "solaris2.*") H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") -ELSE (CMAKE_SYSTEM MATCHES "solaris2.*") - SET(H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) -ENDIF (CMAKE_SYSTEM MATCHES "solaris2.*") +else (CMAKE_SYSTEM MATCHES "solaris2.*") + set (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) +endif (CMAKE_SYSTEM MATCHES "solaris2.*") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'float' or 'double' to 'unsigned long long' values. @@ -1110,19 +1110,19 @@ H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting # 'unsigned long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) - SET (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") -ENDIF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) +if (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) + set (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") + message (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") +endif (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can _compile_ # 'long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) - SET (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") -ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) +if (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) + set (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") + message (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") +endif (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can convert from # 'unsigned long long' to 'long double' without precision loss. @@ -1130,9 +1130,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # where the last 2 bytes of mantissa are lost when compiler tries to do # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting # all floating-point to all integer types. @@ -1150,10 +1150,10 @@ H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows norma # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. # -IF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) - SET (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") - MESSAGE (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") -ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) +if (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) + set (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") + message (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") +endif (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm # to convert some values of '(unsigned) long' to 'long double' values. @@ -1162,10 +1162,10 @@ ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) # ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # -IF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) - SET (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") - MESSAGE (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") -ENDIF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) +if (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) + set (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") + message (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") +endif (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'long double' to '(unsigned) long long' values. (This flag should be set for @@ -1190,10 +1190,10 @@ H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting # (This flag should be set to no for all machines, except for SGI IRIX64, # where the cache value is set to yes in it's config file) # -IF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) - SET (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") - MESSAGE (STATUS "Checking IF your system generates wrong code for log2 routine... no") -ENDIF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) +if (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) + set (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") + message (STATUS "Checking IF your system generates wrong code for log2 routine... no") +endif (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) # ---------------------------------------------------------------------- # Check if pointer alignments are enforced # @@ -1201,21 +1201,21 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # Define a macro for Cygwin (on XP only) where the compiler has rounding # problem converting from unsigned long long to long double */ -IF (CYGWIN) - SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) -ENDIF (CYGWIN) +if (CYGWIN) + set (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) +endif (CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -SET (prefix ${CMAKE_INSTALL_PREFIX}) -SET (exec_prefix "\${prefix}") -SET (libdir "${exec_prefix}/lib") -SET (includedir "\${prefix}/include") -SET (host_os ${CMAKE_HOST_SYSTEM_NAME}) -SET (CC ${CMAKE_C_COMPILER}) -SET (CXX ${CMAKE_CXX_COMPILER}) -SET (FC ${CMAKE_Fortran_COMPILER}) -FOREACH (LINK_LIB ${LINK_LIBS}) - SET (LIBS "${LIBS} -l${LINK_LIB}") -ENDFOREACH (LINK_LIB ${LINK_LIBS}) +set (prefix ${CMAKE_INSTALL_PREFIX}) +set (exec_prefix "\${prefix}") +set (libdir "${exec_prefix}/lib") +set (includedir "\${prefix}/include") +set (host_os ${CMAKE_HOST_SYSTEM_NAME}) +set (CC ${CMAKE_C_COMPILER}) +set (CXX ${CMAKE_CXX_COMPILER}) +set (FC ${CMAKE_Fortran_COMPILER}) +foreach (LINK_LIB ${LINK_LIBS}) + set (LIBS "${LIBS} -l${LINK_LIB}") +endforeach (LINK_LIB ${LINK_LIBS}) diff --git a/config/cmake/FindHDF5.cmake.in b/config/cmake/FindHDF5.cmake.in index 1b51ed4..0ac8bc9 100644 --- a/config/cmake/FindHDF5.cmake.in +++ b/config/cmake/FindHDF5.cmake.in @@ -38,18 +38,18 @@ # To aid in finding HDF5 as part of a subproject set
# HDF5_ROOT_DIR_HINT to the location where @HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies
-INCLUDE (SelectLibraryConfigurations)
-INCLUDE (FindPackageHandleStandardArgs)
+include (SelectLibraryConfigurations)
+include (FindPackageHandleStandardArgs)
# The HINTS option should only be used for values computed from the system.
-SET (_HDF5_HINTS
+set (_HDF5_HINTS
$ENV{HOME}/.local
$ENV{HDF5_ROOT}
$ENV{HDF5_ROOT_DIR_HINT}
)
# Hard-coded guesses should still go in PATHS. This ensures that the user
# environment can always override hard guesses.
-SET (_HDF5_PATHS
+set (_HDF5_PATHS
$ENV{HOME}/.local
$ENV{HDF5_ROOT}
$ENV{HDF5_ROOT_DIR_HINT}
@@ -78,9 +78,9 @@ FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h" # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
# HDF5_INCLUDE_DIRS
-SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+set ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
-IF (HDF5_INCLUDE_DIR)
- SET (HDF5_FOUND "YES")
- INCLUDE (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
-ENDIF (HDF5_INCLUDE_DIR)
+if (HDF5_INCLUDE_DIR)
+ set (HDF5_FOUND "YES")
+ include (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
+endif (HDF5_INCLUDE_DIR)
diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index b358862..f657cfa 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -11,7 +11,7 @@ # SZIP_LIBRARY_DEBUG - Debug version of SZIP library # SZIP_LIBRARY_RELEASE - Release Version of SZIP library -# MESSAGE (STATUS "Finding SZIP library and headers..." ) +# message (STATUS "Finding SZIP library and headers..." ) ############################################ # @@ -25,41 +25,41 @@ ######################################################################### MACRO (SZIP_ADJUST_LIB_VARS basename) - IF (${basename}_INCLUDE_DIR) + if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version - IF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) - SET (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - ENDIF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) + endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version - IF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - IF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") + set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") - IF (${basename}_LIBRARY) - SET (${basename}_FOUND 1) - ENDIF (${basename}_LIBRARY) + if (${basename}_LIBRARY) + set (${basename}_FOUND 1) + endif (${basename}_LIBRARY) - ENDIF (${basename}_INCLUDE_DIR ) + endif (${basename}_INCLUDE_DIR ) # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) @@ -67,19 +67,19 @@ ENDMACRO (SZIP_ADJUST_LIB_VARS) # Look for the header file. -SET (SZIP_INCLUDE_SEARCH_DIRS +set (SZIP_INCLUDE_SEARCH_DIRS $ENV{SZIP_INSTALL}/include $ENV{SZIP_INSTALL}/include/szip /usr/include /usr/include/szip ) -SET (SZIP_LIB_SEARCH_DIRS +set (SZIP_LIB_SEARCH_DIRS $ENV{SZIP_INSTALL}/lib /usr/lib ) -SET (SZIP_BIN_SEARCH_DIRS +set (SZIP_BIN_SEARCH_DIRS $ENV{SZIP_INSTALL}/bin /usr/bin ) @@ -90,13 +90,13 @@ FIND_PATH (SZIP_INCLUDE_DIR NO_DEFAULT_PATH ) -IF (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -ELSE (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -ENDIF (WIN32) +if (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") +else (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") +endif (WIN32) # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -113,67 +113,67 @@ FIND_LIBRARY (SZIP_LIBRARY_RELEASE SZIP_ADJUST_LIB_VARS (SZIP) -IF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - IF (SZIP_LIBRARY_DEBUG) +if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + if (SZIP_LIBRARY_DEBUG) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ELSEIF (SZIP_LIBRARY_RELEASE) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + elseif (SZIP_LIBRARY_RELEASE) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ENDIF (SZIP_LIBRARY_DEBUG) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + endif (SZIP_LIBRARY_DEBUG) -ELSE (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 0) - SET (SZIP_LIBRARIES) - SET (SZIP_INCLUDE_DIRS) -ENDIF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) +else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 0) + set (SZIP_LIBRARIES) + set (SZIP_INCLUDE_DIRS) +endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) # Report the results. -IF (NOT SZIP_FOUND) - SET (SZIP_DIR_MESSAGE +if (NOT SZIP_FOUND) + set (SZIP_DIR_MESSAGE "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) - IF (NOT SZIP_FIND_QUIETLY) - MESSAGE (STATUS "${SZIP_DIR_MESSAGE}") - ELSE (NOT SZIP_FIND_QUIETLY) - IF (SZIP_FIND_REQUIRED) - MESSAGE (FATAL_ERROR "SZip was NOT found and is Required by this project") - ENDIF (SZIP_FIND_REQUIRED) - ENDIF (NOT SZIP_FIND_QUIETLY) -ENDIF (NOT SZIP_FOUND) - -IF (SZIP_FOUND) - INCLUDE (CheckSymbolExists) + if (NOT SZIP_FIND_QUIETLY) + message (STATUS "${SZIP_DIR_MESSAGE}") + else (NOT SZIP_FIND_QUIETLY) + if (SZIP_FIND_REQUIRED) + message (FATAL_ERROR "SZip was NOT found and is Required by this project") + endif (SZIP_FIND_REQUIRED) + endif (NOT SZIP_FIND_QUIETLY) +endif (NOT SZIP_FOUND) + +if (SZIP_FOUND) + include (CheckSymbolExists) ############################################# # Find out if SZIP was build using dll's ############################################# # Save required variable - SET (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - SET (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES - SET (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") CHECK_SYMBOL_EXISTS (SZIP_BUILT_AS_DYNAMIC_LIB "SZconfig.h" HAVE_SZIP_DLL) - IF (HAVE_SZIP_DLL STREQUAL "TRUE") - SET (HAVE_SZIP_DLL "1") - ENDIF (HAVE_SZIP_DLL STREQUAL "TRUE") + if (HAVE_SZIP_DLL STREQUAL "TRUE") + set (HAVE_SZIP_DLL "1") + endif (HAVE_SZIP_DLL STREQUAL "TRUE") # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables - SET (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - SET (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -ENDIF (SZIP_FOUND) - -IF (FIND_SZIP_DEBUG) - MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") - MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") - MESSAGE (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") - MESSAGE (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") - MESSAGE (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") - MESSAGE (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -ENDIF (FIND_SZIP_DEBUG) +endif (SZIP_FOUND) + +if (FIND_SZIP_DEBUG) + message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") + message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") + message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") + message (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") + message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +endif (FIND_SZIP_DEBUG) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 3e6ee18..d0379db 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,31 +1,31 @@ #------------------------------------------------------------------------------- MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) - SET (LIB_OUT_NAME "${libname}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - ELSE (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - ENDIF (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) - IF (WIN32) - SET (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") - ELSE (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + set (LIB_OUT_NAME "${libname}") + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) + else (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + endif (WIN32) + set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) + if (WIN32) + set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") + else (WIN32) + set_target_properties (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries - IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) + if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${libtarget} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) - ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) + endif (APPLE) ENDMACRO (H5_SET_LIB_OPTIONS) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 8fa76b8..69ff5b3 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -7,7 +7,7 @@ ENABLE_LANGUAGE (Fortran) #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- -INCLUDE (FortranCInterface) +include (FortranCInterface) FortranCInterface_HEADER ( ${CMAKE_BINARY_DIR}/FCMangle.h MACRO_NAMESPACE "H5_FC_" @@ -16,26 +16,26 @@ FortranCInterface_HEADER ( ) FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") #----------------------------------------------------------------------------- # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - IF (NOT DEFINED ${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + if (NOT DEFINED ${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) FILE (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "${CODE}" @@ -47,25 +47,25 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) OUTPUT_VARIABLE OUTPUT ) -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") -# MESSAGE ( "Test result ${OUTPUT}") -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "Test result ${OUTPUT}") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - IF (${VARIABLE}) - SET (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - OK") + if (${VARIABLE}) + set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") + message (STATUS "Testing Fortran ${FUNCTION} - OK") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" ) - ELSE (${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - Fail") - SET (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + else (${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION} - Fail") + set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - ENDIF (${VARIABLE}) - ENDIF (NOT DEFINED ${VARIABLE}) + endif (${VARIABLE}) + endif (NOT DEFINED ${VARIABLE}) ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- @@ -131,9 +131,9 @@ CHECK_FORTRAN_FEATURE(iso_c_binding #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- -IF (CMAKE_Fortran_COMPILER MATCHES ifort) - IF (WIN32) - SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - ENDIF (WIN32) -ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) +if (CMAKE_Fortran_COMPILER MATCHES ifort) + if (WIN32) + set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + endif (WIN32) +endif (CMAKE_Fortran_COMPILER MATCHES ifort) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 57e6be7..505a9d5 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -3,7 +3,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (JPEG SVN_REPOSITORY ${JPEG_URL} # [SVN_REVISION rev] @@ -19,7 +19,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG URL ${JPEG_URL} URL_MD5 "" @@ -35,72 +35,72 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (JPEG_LIB_NAME "jpeg_D") - ELSE (WIN32) - SET (JPEG_LIB_NAME "jpeg_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (JPEG_LIB_NAME "jpeg") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (JPEG_LIB_NAME "jpeg_D") + else (WIN32) + set (JPEG_LIB_NAME "jpeg_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (JPEG_LIB_NAME "jpeg") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(jpeg ${libtype} IMPORTED) ADD_DEPENDENCIES (jpeg JPEG) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${JPEG_VERSION_STRING}" SOVERSION "${JPEG_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/JPEG-targets.cmake) - SET (JPEG_LIBRARY "jpeg") +# include (${BINARY_DIR}/JPEG-targets.cmake) + set (JPEG_LIBRARY "jpeg") - SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (JPEG_FOUND 1) - SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) - SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) + set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + set (JPEG_FOUND 1) + set (JPEG_LIBRARIES ${JPEG_LIBRARY}) + set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) ENDMACRO (EXTERNAL_JPEG_LIBRARY) #------------------------------------------------------------------------------- @@ -109,15 +109,15 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_JPEG_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (SZIP SVN_REPOSITORY ${SZIP_URL} # [SVN_REVISION rev] @@ -134,7 +134,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} URL_MD5 "" @@ -151,72 +151,72 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (SZIP_LIB_NAME "szip_D") - ELSE (WIN32) - SET (SZIP_LIB_NAME "szip_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (SZIP_LIB_NAME "szip") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (SZIP_LIB_NAME "szip_D") + else (WIN32) + set (SZIP_LIB_NAME "szip_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (SZIP_LIB_NAME "szip") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(szip ${libtype} IMPORTED) ADD_DEPENDENCIES (szip SZIP) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${SZIP_VERSION_STRING}" SOVERSION "${SZIP_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/SZIP-targets.cmake) - SET (SZIP_LIBRARY "szip") +# include (${BINARY_DIR}/SZIP-targets.cmake) + set (SZIP_LIBRARY "szip") - SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) ENDMACRO (EXTERNAL_SZIP_LIBRARY) #------------------------------------------------------------------------------- @@ -225,15 +225,15 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_SZIP_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (ZLIB SVN_REPOSITORY ${ZLIB_URL} # [SVN_REVISION rev] @@ -249,7 +249,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB URL ${ZLIB_URL} URL_MD5 "" @@ -265,76 +265,76 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib_D") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z") - ENDIF (WIN32) - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib_D") + else (WIN32) + set (ZLIB_LIB_NAME "z_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib") + else (WIN32) + set (ZLIB_LIB_NAME "z") + endif (WIN32) + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(zlib ${libtype} IMPORTED) ADD_DEPENDENCIES (zlib ZLIB) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ZLIB_VERSION_STRING}" SOVERSION "${ZLIB_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/ZLIB-targets.cmake) - SET (ZLIB_LIBRARY "zlib") +# include (${BINARY_DIR}/ZLIB-targets.cmake) + set (ZLIB_LIBRARY "zlib") - SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") + set (ZLIB_FOUND 1) + set (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) ENDMACRO (EXTERNAL_ZLIB_LIBRARY) #------------------------------------------------------------------------------- @@ -343,8 +343,8 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b0788f2..56fdf83 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -1,52 +1,52 @@ #------------------------------------------------------------------------------- MACRO (SET_GLOBAL_VARIABLE name value) - SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) + set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) ENDMACRO (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set(source_group_path "Source/AIM/${NAME}") - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_GENERATED_PROPERTIES) #------------------------------------------------------------------------------- MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) - # INSTALL (FILES ${HEADERS} + # install (FILES ${HEADERS} # DESTINATION include/R3D/${NAME} # COMPONENT Headers # ) - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_NAMING libtarget libtype) - IF (WIN32) - IF (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32) + if (WIN32) + if (${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") + endif (${libtype} MATCHES "SHARED") + endif (WIN32) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb DESTINATION @@ -54,15 +54,15 @@ MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_TARGET_PDB) #------------------------------------------------------------------------------- MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) - GET_TARGET_PROPERTY (target_prefix ${progtarget} PREFIX) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) + get_target_property (target_prefix ${progtarget} PREFIX) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb DESTINATION @@ -70,37 +70,37 @@ MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_PROGRAM_PDB) #------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ELSE (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ELSE (WIN32) + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_D") + else (WIN32) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_debug") - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_debug") + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + set_target_properties (${libtarget} PROPERTIES DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} @@ -109,79 +109,79 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ) #----- Use MSVC Naming conventions for Shared Libraries - IF (MINGW AND ${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + if (MINGW AND ${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" PREFIX "" ) - ENDIF (MINGW AND ${libtype} MATCHES "SHARED") + endif (MINGW AND ${libtype} MATCHES "SHARED") ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) + if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ELSE (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_C_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_MSVC_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (WIN32) + if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ENDIF (WIN32) + endif (WIN32) ENDMACRO (TARGET_FORTRAN_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 175c420..a54f22c 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -11,31 +11,31 @@ # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- MACRO (TARGET_STATIC_CRT_FLAGS) - IF (MSVC AND NOT BUILD_SHARED_LIBS) - FOREACH (flag_var + if (MSVC AND NOT BUILD_SHARED_LIBS) + foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/MD") - STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/MD") - ENDFOREACH (flag_var) - FOREACH (flag_var + if (${flag_var} MATCHES "/MD") + string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/MD") + endforeach (flag_var) + foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/libs:dll") - STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/libs:dll") - ENDFOREACH (flag_var) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) + if (${flag_var} MATCHES "/libs:dll") + string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/libs:dll") + endforeach (flag_var) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + endif (MSVC AND NOT BUILD_SHARED_LIBS) ENDMACRO (TARGET_STATIC_CRT_FLAGS) #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) -IF (BUILD_STATIC_CRT_LIBS) +option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -ENDIF (BUILD_STATIC_CRT_LIBS) +endif (BUILD_STATIC_CRT_LIBS)
\ No newline at end of file diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 43ba754..f715a3f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -4,75 +4,75 @@ # EXTERNAL cache entries
########################
-SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
+set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
+set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
+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_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
-SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" 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 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
-SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" 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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
+set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
+set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
+set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
+set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
+set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
-SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
+set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
-SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
+set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
-SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
+set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
-SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
+set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
-SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
-SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
+set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
-SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
+set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
-SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
+set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
-SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
+set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
-SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
+set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
-SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
+set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
-SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
+set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
-SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
+set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
+set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
-SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
+set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
+set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
-SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
+set (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
+set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
+set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
+set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
+set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 74ac912..7670ad5 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -2,29 +2,29 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FILTER) - MESSAGE (STATUS "Require TEST_FILTER to be defined") -ENDIF (NOT TEST_FILTER) -IF (NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_REFERENCE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FILTER) + message (STATUS "Require TEST_FILTER to be defined") +endif (NOT TEST_FILTER) +if (NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_REFERENCE) -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -37,8 +37,8 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") # now grep the output with the reference FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -46,19 +46,19 @@ FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -IF (${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -ENDIF (${TEST_RESULT} STREQUAL "0") +if (${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") +endif (${TEST_RESULT} STREQUAL "0") STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -IF (${TEST_EXPECT} STREQUAL "1") +if (${TEST_EXPECT} STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") -ENDIF (${TEST_EXPECT} STREQUAL "1") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif (NOT ${TEST_RESULT} STREQUAL "0") +endif (${TEST_EXPECT} STREQUAL "1") # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") +message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index c1201cc..c3d0811 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -2,26 +2,26 @@ # HDF5 Version file for install directory
#-----------------------------------------------------------------------------
-SET (PACKAGE_VERSION @HDF5_VERSION_STRING@)
+set (PACKAGE_VERSION @HDF5_VERSION_STRING@)
-IF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
+if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
# exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
- IF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
+ if ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
# compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
- SET (PACKAGE_VERSION_COMPATIBLE 1)
+ set (PACKAGE_VERSION_COMPATIBLE 1)
- IF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
- SET (PACKAGE_VERSION_EXACT 1)
+ if ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
+ set (PACKAGE_VERSION_EXACT 1)
- IF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
+ if ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
# not using this yet
- ENDIF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
+ endif ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
- ENDIF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
+ endif ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
- ENDIF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
-ENDIF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
+ endif ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
+endif ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index fbe97ac..60888c8 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -6,16 +6,16 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) #-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
+set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
+set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
+set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
+set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
+set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
+set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
+set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
#-----------------------------------------------------------------------------
# Dependencies
@@ -28,46 +28,46 @@ ENDIF(HDF5_ENABLE_PARALLEL) #-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
+set (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
-ENDIF (HDF5_BUILD_FORTRAN)
+if (HDF5_BUILD_FORTRAN)
+ set (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
+endif (HDF5_BUILD_FORTRAN)
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB)
+if (HDF5_BUILD_HL_LIB)
+ set (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_HL_LIB)
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_TOOLS)
+if (HDF5_BUILD_TOOLS)
+ set (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_TOOLS)
-IF (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_DYNAMIC_LIB 1 )
-ELSE (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_STATIC_LIB 1 )
-ENDIF (HDF5_BUILD_SHARED_LIBS)
+if (HDF5_BUILD_SHARED_LIBS)
+ set (H5_BUILT_AS_DYNAMIC_LIB 1 )
+else (HDF5_BUILD_SHARED_LIBS)
+ set (H5_BUILT_AS_STATIC_LIB 1 )
+endif (HDF5_BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
+set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
+set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
+set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already build hdf5 as a subproject
#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
+if (NOT TARGET "@HDF5_PACKAGE@")
+ include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
+endif (NOT TARGET "@HDF5_PACKAGE@")
diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 9c5a5a1..799ff9d 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -4,24 +4,24 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-IF (NOT WIN32)
+if (NOT WIN32)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-ENDIF (NOT WIN32)
+endif (NOT WIN32)
#-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
-SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
+set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
+set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
+set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
+set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
+set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
+set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
+set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
+set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+set (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
#-----------------------------------------------------------------------------
# Dependencies
@@ -34,48 +34,48 @@ ENDIF(HDF5_ENABLE_PARALLEL) #-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
+set (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
-ENDIF (HDF5_BUILD_FORTRAN)
+if (HDF5_BUILD_FORTRAN)
+ set (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
+endif (HDF5_BUILD_FORTRAN)
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" )
-ENDIF (HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" )
+endif (HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" )
-ENDIF (HDF5_BUILD_HL_LIB)
+if (HDF5_BUILD_HL_LIB)
+ set (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" )
+endif (HDF5_BUILD_HL_LIB)
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" )
+endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" )
- SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
-ENDIF (HDF5_BUILD_TOOLS)
+if (HDF5_BUILD_TOOLS)
+ set (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" )
+ set (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
+endif (HDF5_BUILD_TOOLS)
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
+set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
+set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
+set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- INCLUDE (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
+if (NOT TARGET "@HDF5_PACKAGE@")
+ if (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ include (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ if (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ include (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
+endif (NOT TARGET "@HDF5_PACKAGE@")
diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 8ca3879..dd1a311 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -4,78 +4,78 @@ # EXTERNAL cache entries
########################
-SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
+set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
+set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
+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_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
-SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" 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 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
-SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" 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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
+set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
+set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
+set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
+set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
+set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
-SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
+set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
-SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
+set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
-SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
+set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
-SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
+set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
-SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
-SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
+set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
-SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
+set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
-SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
+set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
-SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
+set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
-SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
+set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
-SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
+set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
-SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
+set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
-SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
+set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
+set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
-SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE)
+set (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
+set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
-SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
+set (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
+set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
+set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
+set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
+set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
-SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
+set (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
+set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
diff --git a/config/cmake/prunTest.cmake b/config/cmake/prunTest.cmake index b9ead6f..9cf0c55 100644 --- a/config/cmake/prunTest.cmake +++ b/config/cmake/prunTest.cmake @@ -3,35 +3,35 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +set (ERROR_APPEND 1) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -44,35 +44,35 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) +if (TEST_MASK_ERROR) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -82,64 +82,64 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_ERROR) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -#IF (TEST_REF_FILTER) -# MESSAGE (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +#if (TEST_REF_FILTER) +# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") # FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) # STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") # FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#ENDIF (TEST_REF_FILTER) +#endif (TEST_REF_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 0a80873..9a891e6 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -3,37 +3,37 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -IF (NOT TEST_EXPECT) - MESSAGE (STATUS "Require TEST_EXPECT to be defined") -ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -IF (NOT TEST_ERRREF) - SET (ERROR_APPEND 1) -ENDIF (NOT TEST_ERRREF) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif (NOT TEST_ERRREF) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -46,42 +46,42 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) - IF (NOT TEST_ERRREF) +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - ENDIF (NOT TEST_ERRREF) + endif (NOT TEST_ERRREF) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") @@ -89,105 +89,105 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - IF (NOT TEST_ERRREF) + if (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - ENDIF (NOT TEST_ERRREF) -ENDIF (TEST_MASK_ERROR) + endif (NOT TEST_ERRREF) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) - IF (TEST_ERRREF) - IF (WIN32 AND NOT MINGW) + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the error output with the error reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) LIST (LENGTH test_ref len_ref) MATH (EXPR _FP_LEN "${len_ref} - 1") - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - ENDIF (TEST_ERRREF) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif (NOT ${TEST_RESULT} STREQUAL 0) + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 8910bb2..2b6b934 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -2,44 +2,44 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -ENDIF (NOT TEST_PROGRAM) -IF (NOT TEST_GET_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -ENDIF (NOT TEST_GET_PROGRAM) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_HFILE) - MESSAGE (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -ENDIF (NOT TEST_HFILE) -IF (NOT TEST_UFILE) - MESSAGE (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -ENDIF (NOT TEST_UFILE) -IF (NOT TEST_CHECKUB) - MESSAGE (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -ENDIF (NOT TEST_CHECKUB) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_OFILE) -# MESSAGE (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#ENDIF (NOT TEST_OFILE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") +endif (NOT TEST_PROGRAM) +if (NOT TEST_GET_PROGRAM) + message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") +endif (NOT TEST_GET_PROGRAM) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_HFILE) + message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") +endif (NOT TEST_HFILE) +if (NOT TEST_UFILE) + message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") +endif (NOT TEST_UFILE) +if (NOT TEST_CHECKUB) + message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") +endif (NOT TEST_CHECKUB) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_OFILE) +# message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") +#endif (NOT TEST_OFILE) -SET (TEST_U_STRING_LEN 0) -SET (TEST_O_STRING_LEN 0) -SET (TEST_H_STRING_LEN 0) -SET (TEST_STRING_SIZE 0) +set (TEST_U_STRING_LEN 0) +set (TEST_O_STRING_LEN 0) +set (TEST_H_STRING_LEN 0) +set (TEST_STRING_SIZE 0) -IF (TEST_CHECKUB STREQUAL "YES") +if (TEST_CHECKUB STREQUAL "YES") # find the length of the user block to check #s1=`cat $ufile | wc -c | sed -e 's/ //g'` FILE (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) - STRING (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) + string (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) # Get the size of the original user block, if any. - IF (TEST_OFILE) + if (TEST_OFILE) # 'tellub' calls H5Fget_user_block to get the size # of the user block #s2=`$JAM_BIN/tellub $origfile` @@ -51,15 +51,15 @@ IF (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL "0") FILE (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - ENDIF (TEST_OFILE) + endif (TEST_OFILE) MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - IF (NOT TEST_O_STRING_LEN STREQUAL "0") + if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -73,10 +73,10 @@ IF (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") + else (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") + endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -95,12 +95,12 @@ IF (TEST_CHECKUB STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") + message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -ELSE (TEST_CHECKUB STREQUAL "YES") + if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +else (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -110,11 +110,11 @@ ELSE (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT TEST_H_STRING_LEN STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - ENDIF (NOT TEST_H_STRING_LEN STREQUAL "0") -ENDIF (TEST_CHECKUB STREQUAL "YES") + if (NOT TEST_H_STRING_LEN STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") + endif (NOT TEST_H_STRING_LEN STREQUAL "0") +endif (TEST_CHECKUB STREQUAL "YES") # everything went fine... -MESSAGE ("Passed: The output of CHECK matched expectation") +message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 2e854fb..f12dee7 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -2,27 +2,27 @@ # Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_VFD) - MESSAGE (FATAL_ERROR "Require TEST_VFD to be defined") -ENDIF (NOT TEST_VFD) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -SET (ENV{HDF5_DRIVER} "${TEST_VFD}") +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_VFD) + message (FATAL_ERROR "Require TEST_VFD to be defined") +endif (NOT TEST_VFD) + +set (ERROR_APPEND 1) + +message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +set (ENV{HDF5_DRIVER} "${TEST_VFD}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} @@ -33,18 +33,18 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) # everything went fine... -MESSAGE ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") +message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e7a1326..088a238 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -4,12 +4,12 @@ PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_crtdat h5_rdwt h5_crtatt @@ -36,22 +36,22 @@ SET (examples h5_shared_mesg ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (${example} " " " ") - TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) -ENDFOREACH (example ${examples}) + target_link_libraries (${example} ${HDF5_LIB_TARGET}) + set_target_properties (${example} PROPERTIES FOLDER examples) +endforeach (example ${examples}) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) +if (H5_HAVE_PARALLEL) + add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5example " " " ") - TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + set_target_properties (ph5example PROPERTIES FOLDER examples) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 58a2858..a8a9829 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -43,23 +43,23 @@ red/prefix_target.h5 u2w/u2w_target.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-clear-objects") - FOREACH (example ${examples}) + foreach (example ${examples}) ADD_TEST (NAME EXAMPLES-${example} COMMAND $<TARGET_FILE:${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-${example}") - ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-${example}") + endforeach (example ${examples}) - IF (H5_HAVE_PARALLEL) + if (H5_HAVE_PARALLEL) ADD_TEST (NAME EXAMPLES-ph5example COMMAND $<TARGET_FILE:ph5example>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-ph5example") - ENDIF (H5_HAVE_PARALLEL) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-ph5example") + endif (H5_HAVE_PARALLEL) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9dbe8ca..c13f3c6 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5_F90 C CXX Fortran) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) FIND_PACKAGE (MPI) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -13,16 +13,16 @@ ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) - IF (MPI_Fortran_FOUND) + if (MPI_Fortran_FOUND) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - ENDIF (MPI_Fortran_FOUND) -ENDIF (BUILD_TESTING) + endif (MPI_Fortran_FOUND) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index f57df63..80318a4 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -13,7 +13,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_cmprss h5_crtdat h5_rdwt @@ -31,69 +31,69 @@ SET (examples compound ) -SET (F2003_examples +set (F2003_examples rwdset_fortran2003 nested_derived_type compound_fortran2003 compound_complex_fortran2003 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES FOLDER examples/fortran) -ENDFOREACH (example ${examples}) + set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran) +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) - ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) + add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f03_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f03_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f03_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) + set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_ph5example + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_ph5example + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index aebd39b..997d7a1 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -24,29 +24,29 @@ sdsf.h5 subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex-clear-objects") -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex_${example}") -ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex_${example}") +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f03_ex_${example}") - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f03_ex_${example}") + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:f90_ex_ph5example>) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index b040fd1..bc87906 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -3,19 +3,19 @@ PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - IF (MSVC) - IF (NOT H5_HAVE_PARALLEL) - SET (H5_NOPAREXP ";") - ENDIF (NOT H5_HAVE_PARALLEL) - IF (NOT HDF5_ENABLE_F2003) - SET (H5_NOF03EXP ";") - ENDIF (NOT HDF5_ENABLE_F2003) +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + if (MSVC) + if (NOT H5_HAVE_PARALLEL) + set (H5_NOPAREXP ";") + endif (NOT H5_HAVE_PARALLEL) + if (NOT HDF5_ENABLE_F2003) + set (H5_NOF03EXP ";") + endif (NOT HDF5_ENABLE_F2003) CONFIGURE_FILE (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) -ENDIF (WIN32 AND NOT CYGWIN) + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -23,31 +23,31 @@ ENDIF (WIN32 AND NOT CYGWIN) # H5fortran_detect.f90 used to generate H5fort_type_defines.h # H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.f90 #----------------------------------------------------------------------------- -IF (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +if (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 ) -ELSE (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +else (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) -ENDIF (FORTRAN_HAVE_SIZEOF) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind +endif (FORTRAN_HAVE_SIZEOF) +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5test_FortranHavekind PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind + 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) +endif (WIN32 AND MSVC) +set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $<TARGET_FILE:H5test_FortranHavekind>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5test_FortranHavekind>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 @@ -55,25 +55,25 @@ ADD_CUSTOM_COMMAND ( DEPENDS H5test_FortranHavekind ) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5fortran_detect +add_executable (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 ) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect + endif (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) +endif (WIN32 AND MSVC) +set_target_properties (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $<TARGET_FILE:H5fortran_detect>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5fortran_detect>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @@ -83,12 +83,12 @@ ADD_CUSTOM_COMMAND ( INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5match_types +add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -SET (CMD $<TARGET_FILE:H5match_types>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5match_types>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 COMMAND ${CMD} @@ -99,7 +99,7 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # f90CStub lib #----------------------------------------------------------------------------- -SET (f90CStub_C_SRCS +set (f90CStub_C_SRCS # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c @@ -118,54 +118,54 @@ SET (f90CStub_C_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c ) -IF (H5_HAVE_PARALLEL) - SET (f90CStub_C_SRCS +if (H5_HAVE_PARALLEL) + set (f90CStub_C_SRCS ${f90CStub_C_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) -SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) -SET (f90CStub_C_HDRS +set (f90CStub_C_HDRS # generated files ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) -ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) +add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran 2003 standard #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) # default real is 4 bytes, so include double signatures - SET (F_STATUS "_F03") -ELSE (HDF5_ENABLE_F2003) + set (F_STATUS "_F03") +else (HDF5_ENABLE_F2003) # default real is 8 bytes, so exclude double signatures - SET (F_STATUS "_F90") -ENDIF (HDF5_ENABLE_F2003) + set (F_STATUS "_F90") +endif (HDF5_ENABLE_F2003) #----------------------------------------------------------------------------- # Fortran Real Size #----------------------------------------------------------------------------- -IF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +if (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 4 bytes, so include double signatures - SET (F_DBLE "Include") -ELSE (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Include") +else (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 8 bytes, so exclude double signatures - SET (F_DBLE "Exclude") -ENDIF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Exclude") +endif (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (f90_F_SRCS +set (f90_F_SRCS # generated files ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 @@ -201,53 +201,53 @@ SET (f90_F_SRCS #----------------------------------------------------------------------------- # Add H5FDMPIO if parallel #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 ) -ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 ) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) #----------------------------------------------------------------------------- # Add Main fortran library #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} +add_library (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) +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_BINARY_DIR}/hdf5_fortrandll.def") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_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) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_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}) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") +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}) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") 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) +set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h @@ -260,8 +260,8 @@ INSTALL ( fortheaders ) -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -269,8 +269,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -278,18 +278,18 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -299,4 +299,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT fortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 643ec94..4b8a8e9 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -9,42 +9,42 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} +target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) -ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) -ENDIF (WIN32 AND NOT CYGWIN) +add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) +set (SHARED_LINK_FLAGS " ") +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_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} +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} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- #-- Adding test for testhdf5_fortran -ADD_EXECUTABLE (testhdf5_fortran +add_executable (testhdf5_fortran fortranlib_test.f90 tH5A.f90 tH5D.f90 @@ -62,19 +62,19 @@ ADD_EXECUTABLE (testhdf5_fortran ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran +target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -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) -SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran) +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) +set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran) #-- Adding test for testhdf5_fortran_1_8 -ADD_EXECUTABLE (testhdf5_fortran_1_8 +add_executable (testhdf5_fortran_1_8 fortranlib_test_1_8.f90 tH5F.f90 tH5O.f90 @@ -83,20 +83,20 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 +target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -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) -SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) +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) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) - ADD_EXECUTABLE (fortranlib_test_F03 +if (HDF5_ENABLE_F2003) + add_executable (fortranlib_test_F03 fortranlib_test_F03.f90 tH5F.f90 tH5E_F03.f90 @@ -108,46 +108,46 @@ IF (HDF5_ENABLE_F2003) ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") - TARGET_LINK_LIBRARIES (fortranlib_test_F03 + target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib") - ENDIF (WIN32 AND MSVC) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) -ENDIF (HDF5_ENABLE_F2003) + if (WIN32 AND MSVC) + target_link_libraries (fortranlib_test_F03 "ws2_32.lib") + endif (WIN32 AND MSVC) + set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 -ADD_EXECUTABLE (fflush1 fflush1.f90) +add_executable (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") -TARGET_LINK_LIBRARIES (fflush1 +target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush1 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush1 PROPERTIES FOLDER test/fortran) #-- Adding test for fflush2 -ADD_EXECUTABLE (fflush2 fflush2.f90) +add_executable (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") -TARGET_LINK_LIBRARIES (fflush2 +target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush2 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush2 PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index d381b62..87d691f 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -13,10 +13,10 @@ ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>) SET_TESTS_PROPERTIES(testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) ADD_TEST (NAME fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>) SET_TESTS_PROPERTIES(fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") -ENDIF (HDF5_ENABLE_F2003) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index d1aba51..54da542 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -11,23 +11,23 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- #-- Adding test for parallel_test -ADD_EXECUTABLE (parallel_test +add_executable (parallel_test ptest.f90 hyper.f90 mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") -TARGET_LINK_LIBRARIES (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) -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) -SET_TARGET_PROPERTIES (parallel_test PROPERTIES FOLDER test/fortran) +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) +set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 5c9403d..c6c0f82 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files @@ -23,22 +23,22 @@ INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools -IF (HDF5_BUILD_TOOLS) +if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -ENDIF (HDF5_BUILD_TOOLS) +endif (HDF5_BUILD_TOOLS) #-- Add High Level Examples -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #-- Build the Unit testing if requested -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (BUILD_TESTING) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - ENDIF (BUILD_TESTING) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (BUILD_TESTING) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) -IF (HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_CPP_LIB) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) -ENDIF (HDF5_BUILD_CPP_LIB) +endif (HDF5_BUILD_CPP_LIB) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 8d68dd0..d641eae 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -9,14 +9,14 @@ ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper # -------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index f762839..ca086db 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -10,17 +10,17 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) +add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) TARGET_NAMING (ptExampleFL ${LIB_TYPE}) TARGET_C_PROPERTIES (ptExampleFL " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_TARGET_PROPERTIES (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) +set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 34e1a7a..9f8d3f8 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -7,24 +7,24 @@ PROJECT (HDF5_HL_CPP_SRC) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) -SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) -SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) +set (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) +set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +add_library (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION @@ -36,12 +36,12 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_HL_CPP_LIB_TARGET} EXPORT @@ -50,4 +50,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlcpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlcpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 46229ba..82a4df0 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -15,10 +15,10 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/test) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) -ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) TARGET_C_PROPERTIES (hl_ptableTest " " " ") TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) -TARGET_LINK_LIBRARIES ( +target_link_libraries ( hl_ptableTest ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -26,6 +26,6 @@ TARGET_LINK_LIBRARIES ( ${HDF5_HL_LIB_TARGET} ${HDF5_HL_CPP_LIB_TARGET} ) -SET_TARGET_PROPERTIES (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) +set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index a9c5258..2d621ca 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples ex_lite1 ex_lite2 #ex_lite2 PROPERTIES DEPENDS ex_lite1) ex_lite3 @@ -26,16 +26,16 @@ SET (examples ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) -ENDFOREACH (example ${examples}) + target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 0f9ca11..380c1ec 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -5,21 +5,21 @@ ############################################################################## ############################################################################## -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES image24pixel.txt image8.txt ) -FOREACH (h5_file ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET hl_ex_ex_ds1 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_TEST_FILES}) +endforeach (h5_file ${HDF5_TEST_FILES}) # Remove any output file left over from previous test run ADD_TEST ( @@ -46,15 +46,15 @@ ENDFOREACH (h5_file ${HDF5_TEST_FILES}) ex_table_12.h5 ex_ds1.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex-clear-objects") -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex_${example}") -ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex_${example}") +endforeach (example ${examples}) diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 0da0825..f0ff22d 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -9,13 +9,13 @@ ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_FORTRAN_EXAMPLES) +if (HDF5_BUILD_FORTRAN_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_FORTRAN_EXAMPLES) +endif (HDF5_BUILD_FORTRAN_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 0f663c7..189c9cc 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -10,27 +10,27 @@ INCLUDE_DIRECTORIES ( ${HDF5_F90_SRC_DIR}/src ) -SET (examples +set (examples exlite ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -ENDFOREACH (example ${examples}) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 7e6c348..1eb7b47 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -5,6 +5,6 @@ ############################################################################## ############################################################################## -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME hl_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>) -ENDFOREACH (example ${examples}) +endforeach (example ${examples}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 22353f8..9efcbc8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -14,66 +14,66 @@ INCLUDE_DIRECTORIES ( #----------------------------------------------------------------------------- # hl_f90CStub lib #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_C_SRCS +set (HDF5_HL_F90_C_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBfc.c ) -SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) -SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) +set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) -ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +add_library (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_F_SRCS +set (HDF5_HL_F90_F_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 ) -ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} +add_library (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) +set (SHARED_LINK_FLAGS " ") +if (BUILD_SHARED_LIBS) + if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL ) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (WIN32 AND NOT CYGWIN) -ENDIF (BUILD_SHARED_LIBS) -IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (WIN32 AND NOT CYGWIN) +endif (BUILD_SHARED_LIBS) +if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -81,8 +81,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -90,17 +90,17 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) - INSTALL ( + install ( TARGETS ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_LIB_TARGET} @@ -110,4 +110,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlfortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlfortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 2084162..23c199c 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -7,35 +7,35 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #-- Adding test for hl_f90_tstds -ADD_EXECUTABLE (hl_f90_tstds tstds.f90) +add_executable (hl_f90_tstds tstds.f90) TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstlite -ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) +add_executable (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstimage -ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) +add_executable (hl_f90_tstimage tstimage.f90) TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tsttable -ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) +add_executable (hl_f90_tsttable tsttable.f90) TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 5904d05..5bfac2a 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -SET (HL_SRCS +set (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5DO.c ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c ${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c @@ -24,7 +24,7 @@ SET (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c ) -SET (HL_HEADERS +set (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/H5DOpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h @@ -35,17 +35,17 @@ SET (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h ) -ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +add_library (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") +target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HL_HEADERS} DESTINATION @@ -57,11 +57,11 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) - INSTALL ( + install ( TARGETS ${HDF5_HL_LIB_TARGET} EXPORT @@ -70,4 +70,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hllibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hllibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index f969dbf..2853438 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT (HDF5_HL_TEST) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) @@ -21,15 +21,15 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) - ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) + add_executable (hl_${hl_name} ${hl_name}.c) TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_${hl_name} " " " ") - TARGET_LINK_LIBRARIES (hl_${hl_name} + target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) + set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) ENDMACRO (HL_ADD_EXE) HL_ADD_EXE (test_ds) @@ -43,16 +43,16 @@ HL_ADD_EXE (test_table) # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed # -------------------------------------------------------------------- -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_gen_test_ds gen_test_ds.c) TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_gen_test_ds " " " ") - TARGET_LINK_LIBRARIES (hl_gen_test_ds + target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 5d42b57..ebbc353 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -10,24 +10,24 @@ # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name files) ADD_TEST (NAME hl_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- #-- Copy the necessary files. # -------------------------------------------------------------------- - FOREACH (h5_file ${files}) - SET (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying HL Test File ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${files}) + set (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying HL Test File ${h5_file} to ${dest}") + add_custom_command ( TARGET hl_${hl_name} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TEST_SOURCE_DIR}/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HL_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) ENDMACRO (HL_ADD_TEST) # Remove any output file left over from previous test run @@ -60,10 +60,10 @@ ADD_TEST ( test_packet_table.h5 test_table.h5 ) -IF (NOT "${last_test}" STREQUAL "") +if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) -ENDIF (NOT "${last_test}" STREQUAL "") -SET (last_test "hl_test-clear-objects") +endif (NOT "${last_test}" STREQUAL "") +set (last_test "hl_test-clear-objects") HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") HL_ADD_TEST (test_dset_opt "") diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 256ff89..a8674e7 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_HL_TOOLS) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (GIF2H5_SRCS +set (GIF2H5_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif.h ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/decompress.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2hdf.c @@ -17,46 +17,46 @@ SET (GIF2H5_SRCS INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) -ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) +add_executable (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) TARGET_C_PROPERTIES (gif2h5 " " " ") -TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) +target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) #-- Add h52gif program -SET (hdf2gif_SRCS +set (hdf2gif_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdf2gif.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c ) -ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) +add_executable (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) TARGET_C_PROPERTIES (h52gif " " " ") -TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) +target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h52gif PROPERTIES FOLDER tools/hl) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not # used in the CMake Build system as we rely on the test files that are # shipped with HDF5 source archives # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_h52gifgentest " " " ") - TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) + target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # ADD_TEST (NAME hl_h52gifgentest COMMAND $<TARGET_FILE:hl_h52gifgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( TARGETS gif2h5 h52gif diff --git a/hl/tools/CMakeTests.cmake b/hl/tools/CMakeTests.cmake index 9f987fd..df419c3 100644 --- a/hl/tools/CMakeTests.cmake +++ b/hl/tools/CMakeTests.cmake @@ -12,14 +12,14 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy test files from source to build dir # -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET gif2h5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/testfiles/image1.gif ${PROJECT_BINARY_DIR}/testfiles/image1.gif ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET h52gif POST_BUILD COMMAND ${CMAKE_COMMAND} diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 0a6fa10..2ea0c32 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -16,125 +16,125 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Add the executables # -------------------------------------------------------------------- #-- Adding test for h5perf_serial -SET (h5perf_serial_SRCS +set (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) -ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) +add_executable (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial " " " ") -TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) +target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5perf_serial PROPERTIES FOLDER perform) -IF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone - SET (h5perf_serial_alone_SRCS + set (h5perf_serial_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) - ADD_EXECUTABLE (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_serial_alone + add_executable (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) +endif (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for chunk -SET (chunk_SRCS +set (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) TARGET_C_PROPERTIES (chunk " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) +set_target_properties (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe -SET (iopipe_SRCS +set (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) -ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) +add_executable (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) TARGET_C_PROPERTIES (iopipe " " " ") -TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) +target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (iopipe PROPERTIES FOLDER perform) #-- Adding test for overhead -SET (overhead_SRCS +set (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) -ADD_EXECUTABLE (overhead ${overhead_SRCS}) +add_executable (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) TARGET_C_PROPERTIES (overhead " " " ") -TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) +target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta -SET (perf_meta_SRCS +set (perf_meta_SRCS ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) -ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) +add_executable (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) TARGET_C_PROPERTIES (perf_meta " " " ") -TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) +target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf -SET (zip_perf_SRCS +set (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) -ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) +add_executable (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) TARGET_C_PROPERTIES (zip_perf " " " ") -TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) +target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (zip_perf PROPERTIES FOLDER perform) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #-- Adding test for h5perf - SET (h5perf_SRCS + set (h5perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) + add_executable (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf " " " ") - TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) + target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf PROPERTIES FOLDER perform) - IF (HDF5_BUILD_PERFORM_STANDALONE) + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf - SET (h5perf_alone_SRCS + set (h5perf_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf_alone ${h5perf_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_alone + add_executable (h5perf_alone ${h5perf_alone_SRCS}) + set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf_alone PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PERFORM_STANDALONE) - IF (HDF5_BUILD_PARALLEL_ALL) + if (HDF5_BUILD_PARALLEL_ALL) #-- Adding test for benchpar - SET (benchpar_SRCS + set (benchpar_SRCS ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) - ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) + add_executable (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_C_PROPERTIES (benchpar " " " ") - TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (benchpar PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/perform/CMakeTests.cmake b/perform/CMakeTests.cmake index fab6ab2..1b93753 100644 --- a/perform/CMakeTests.cmake +++ b/perform/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET zip_perf POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -33,9 +33,9 @@ ADD_TEST ( ADD_TEST (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>) -IF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) +endif (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>) @@ -48,14 +48,14 @@ ADD_TEST (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>) ADD_TEST (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h") ADD_TEST (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) ADD_TEST (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>) - IF (HDF5_BUILD_PERFORM_STANDALONE) + if (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf_alone>) - ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + endif (HDF5_BUILD_PERFORM_STANDALONE) - IF (HDF5_BUILD_PARALLEL_ALL) + if (HDF5_BUILD_PARALLEL_ALL) ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 438d7e2..dc359f6 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -286,42 +286,42 @@ These five steps are described in detail below. ######################## # EXTERNAL cache entries ######################## - SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) - SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) - SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) - 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_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) - SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) - SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) - SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) - SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) - SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) - SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) - SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) - SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) - SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + 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_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) + set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) + set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) + set (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) 2. Configure the cache settings @@ -462,7 +462,7 @@ HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF 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) +if (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF ---------------- HDF5 Advanced Options --------------------- @@ -490,13 +490,13 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -IF (APPLE) +if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF -IF (CMAKE_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_TRACE "Enable API tracing capability" ON -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -IF (WIN32 AND NOT CYGWIN) +if (WIN32 AND NOT CYGWIN) HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF ---------------- External Library Options --------------------- @@ -509,13 +509,13 @@ HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON -IF (HDF5_ENABLE_SZIP_SUPPORT) +if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF -IF (WINDOWS) +if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -ELSE (WINDOWS) +else (WINDOWS) H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -ENDIF (WINDOWS) +endif (WINDOWS) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 313e0f0..227a89c 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -192,16 +192,16 @@ PROJECT (HDF5MyApp C CXX) FIND_PACKAGE (HDF5 NAMES hdf5) # FIND_PACKAGE (HDF5) # Find non-cmake built HDF5 INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) -SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) +set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) -SET (example hdf_example) +set (example hdf_example) -ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) TARGET_C_PROPERTIES (${example} " " " ") -TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) +target_link_libraries (${example} ${LINK_LIBS}) ENABLE_TESTING () -INCLUDE (CTest) +include (CTest) ADD_TEST (NAME test_example COMMAND ${example}) ########################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c626065..db26166 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,12 +4,12 @@ PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # List Source Files #----------------------------------------------------------------------------- -SET (H5_SRCS +set (H5_SRCS ${HDF5_SRC_DIR}/H5.c ${HDF5_SRC_DIR}/H5checksum.c ${HDF5_SRC_DIR}/H5dbg.c @@ -18,7 +18,7 @@ SET (H5_SRCS ${HDF5_SRC_DIR}/H5trace.c ) -SET (H5_HDRS +set (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h ${HDF5_SRC_DIR}/H5public.h @@ -27,7 +27,7 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) -SET (H5A_SRCS +set (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c ${HDF5_SRC_DIR}/H5Adense.c @@ -36,35 +36,35 @@ SET (H5A_SRCS ${HDF5_SRC_DIR}/H5Atest.c ) -SET (H5A_HDRS +set (H5A_HDRS ${HDF5_SRC_DIR}/H5Apkg.h ${HDF5_SRC_DIR}/H5Apublic.h ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) -SET (H5AC_SRCS +set (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) -SET (H5AC_HDRS +set (H5AC_HDRS ${HDF5_SRC_DIR}/H5ACpkg.h ${HDF5_SRC_DIR}/H5ACpublic.h ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) -SET (H5B_SRCS +set (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c ${HDF5_SRC_DIR}/H5Bcache.c ${HDF5_SRC_DIR}/H5Bdbg.c ) -SET (H5B_HDRS +set (H5B_HDRS ${HDF5_SRC_DIR}/H5Bpkg.h ${HDF5_SRC_DIR}/H5Bpublic.h ) IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) -SET (H5B2_SRCS +set (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2.c ${HDF5_SRC_DIR}/H5B2cache.c ${HDF5_SRC_DIR}/H5B2dbg.c @@ -73,32 +73,32 @@ SET (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2stat.c ${HDF5_SRC_DIR}/H5B2test.c ) -SET (H5B2_HDRS +set (H5B2_HDRS ${HDF5_SRC_DIR}/H5B2pkg.h ${HDF5_SRC_DIR}/H5B2public.h ) IDE_GENERATED_PROPERTIES ("H5B2" "${H5B2_HDRS}" "${H5B2_SRCS}" ) -SET (H5C_SRCS +set (H5C_SRCS ${HDF5_SRC_DIR}/H5C.c ) -SET (H5C_HDRS +set (H5C_HDRS ${HDF5_SRC_DIR}/H5Cpkg.h ${HDF5_SRC_DIR}/H5Cpublic.h ) IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) -SET (H5CS_SRCS +set (H5CS_SRCS ${HDF5_SRC_DIR}/H5CS.c ) -SET (H5CS_HDRS +set (H5CS_HDRS ) IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SRCS}" ) -SET (H5D_SRCS +set (H5D_SRCS ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dbtree.c ${HDF5_SRC_DIR}/H5Dchunk.c @@ -118,19 +118,19 @@ SET (H5D_SRCS ${HDF5_SRC_DIR}/H5Dtest.c ) -SET (H5D_HDRS +set (H5D_HDRS ${HDF5_SRC_DIR}/H5Dpkg.h ${HDF5_SRC_DIR}/H5Dpublic.h ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) -SET (H5E_SRCS +set (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c ${HDF5_SRC_DIR}/H5Eint.c ) -SET (H5E_HDRS +set (H5E_HDRS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epkg.h @@ -141,7 +141,7 @@ SET (H5E_HDRS IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) -SET (H5EA_SRCS +set (H5EA_SRCS ${HDF5_SRC_DIR}/H5EA.c ${HDF5_SRC_DIR}/H5EAcache.c ${HDF5_SRC_DIR}/H5EAdbg.c @@ -154,13 +154,13 @@ SET (H5EA_SRCS ${HDF5_SRC_DIR}/H5EAstat.c ${HDF5_SRC_DIR}/H5EAtest.c ) -SET (H5EA_HDRS +set (H5EA_HDRS ${HDF5_SRC_DIR}/H5EApkg.h ) IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) -SET (H5F_SRCS +set (H5F_SRCS ${HDF5_SRC_DIR}/H5F.c ${HDF5_SRC_DIR}/H5Faccum.c ${HDF5_SRC_DIR}/H5Fcwfs.c @@ -178,14 +178,14 @@ SET (H5F_SRCS ${HDF5_SRC_DIR}/H5Ftest.c ) -SET (H5F_HDRS +set (H5F_HDRS ${HDF5_SRC_DIR}/H5Fpkg.h ${HDF5_SRC_DIR}/H5Fpublic.h ) IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) -SET (H5FA_SRCS +set (H5FA_SRCS ${HDF5_SRC_DIR}/H5FA.c ${HDF5_SRC_DIR}/H5FAcache.c ${HDF5_SRC_DIR}/H5FAdbg.c @@ -195,13 +195,13 @@ SET (H5FA_SRCS ${HDF5_SRC_DIR}/H5FAstat.c ${HDF5_SRC_DIR}/H5FAtest.c ) -SET (H5FA_HDRS +set (H5FA_HDRS ${HDF5_SRC_DIR}/H5FApkg.h ) IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) -SET (H5FD_SRCS +set (H5FD_SRCS ${HDF5_SRC_DIR}/H5FD.c ${HDF5_SRC_DIR}/H5FDcore.c ${HDF5_SRC_DIR}/H5FDdirect.c @@ -218,7 +218,7 @@ SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FDwindows.c ) -SET (H5FD_HDRS +set (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDcore.h ${HDF5_SRC_DIR}/H5FDdirect.h ${HDF5_SRC_DIR}/H5FDfamily.h @@ -236,23 +236,23 @@ SET (H5FD_HDRS IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) -SET (H5FL_SRCS +set (H5FL_SRCS ${HDF5_SRC_DIR}/H5FL.c ) -SET (H5FL_HDRS +set (H5FL_HDRS ) IDE_GENERATED_PROPERTIES ("H5FL" "${H5FL_HDRS}" "${H5FL_SRCS}" ) -SET (H5FO_SRCS +set (H5FO_SRCS ${HDF5_SRC_DIR}/H5FO.c ) -SET (H5FO_HDRS +set (H5FO_HDRS ) IDE_GENERATED_PROPERTIES ("H5FO" "${H5FO_HDRS}" "${H5FO_SRCS}" ) -SET (H5FS_SRCS +set (H5FS_SRCS ${HDF5_SRC_DIR}/H5FS.c ${HDF5_SRC_DIR}/H5FScache.c ${HDF5_SRC_DIR}/H5FSdbg.c @@ -261,13 +261,13 @@ SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FStest.c ) -SET (H5FS_HDRS +set (H5FS_HDRS ${HDF5_SRC_DIR}/H5FSpkg.h ${HDF5_SRC_DIR}/H5FSpublic.h ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) -SET (H5G_SRCS +set (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c ${HDF5_SRC_DIR}/H5Gcache.c @@ -288,13 +288,13 @@ SET (H5G_SRCS ${HDF5_SRC_DIR}/H5Gtraverse.c ) -SET (H5G_HDRS +set (H5G_HDRS ${HDF5_SRC_DIR}/H5Gpkg.h ${HDF5_SRC_DIR}/H5Gpublic.h ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) -SET (H5HF_SRCS +set (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c ${HDF5_SRC_DIR}/H5HFcache.c @@ -313,101 +313,101 @@ SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HFtiny.c ) -SET (H5HF_HDRS +set (H5HF_HDRS ${HDF5_SRC_DIR}/H5HFpkg.h ${HDF5_SRC_DIR}/H5HFpublic.h ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) -SET (H5HG_SRCS +set (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c ${HDF5_SRC_DIR}/H5HGdbg.c ${HDF5_SRC_DIR}/H5HGquery.c ) -SET (H5HG_HDRS +set (H5HG_HDRS ${HDF5_SRC_DIR}/H5HGpkg.h ${HDF5_SRC_DIR}/H5HGpublic.h ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) -SET (H5HL_SRCS +set (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c ${HDF5_SRC_DIR}/H5HLdbg.c ${HDF5_SRC_DIR}/H5HLint.c ) -SET (H5HL_HDRS +set (H5HL_HDRS ${HDF5_SRC_DIR}/H5HLpkg.h ${HDF5_SRC_DIR}/H5HLpublic.h ) IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) -SET (H5HP_SRCS +set (H5HP_SRCS ${HDF5_SRC_DIR}/H5HP.c ) -SET (H5HP_HDRS +set (H5HP_HDRS ) IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SRCS}" ) -SET (H5I_SRCS +set (H5I_SRCS ${HDF5_SRC_DIR}/H5I.c ${HDF5_SRC_DIR}/H5Itest.c ) -SET (H5I_HDRS +set (H5I_HDRS ${HDF5_SRC_DIR}/H5Ipkg.h ${HDF5_SRC_DIR}/H5Ipublic.h ) IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SRCS}" ) -SET (H5L_SRCS +set (H5L_SRCS ${HDF5_SRC_DIR}/H5L.c ${HDF5_SRC_DIR}/H5Lexternal.c ) -SET (H5L_HDRS +set (H5L_HDRS ${HDF5_SRC_DIR}/H5Lpkg.h ${HDF5_SRC_DIR}/H5Lpublic.h ) IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SRCS}" ) -SET (H5MF_SRCS +set (H5MF_SRCS ${HDF5_SRC_DIR}/H5MF.c ${HDF5_SRC_DIR}/H5MFaggr.c ${HDF5_SRC_DIR}/H5MFdbg.c ${HDF5_SRC_DIR}/H5MFsection.c ) -SET (H5MF_HDRS +set (H5MF_HDRS ) IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) -SET (H5MM_SRCS +set (H5MM_SRCS ${HDF5_SRC_DIR}/H5MM.c ) -SET (H5MM_HDRS +set (H5MM_HDRS ${HDF5_SRC_DIR}/H5MMpublic.h ) IDE_GENERATED_PROPERTIES ("H5MM" "${H5MM_HDRS}" "${H5MM_SRCS}" ) -SET (H5MP_SRCS +set (H5MP_SRCS ${HDF5_SRC_DIR}/H5MP.c ${HDF5_SRC_DIR}/H5MPtest.c ) -SET (H5MP_HDRS +set (H5MP_HDRS ${HDF5_SRC_DIR}/H5MPpkg.h ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) -SET (H5O_SRCS +set (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c ${HDF5_SRC_DIR}/H5Oalloc.c @@ -443,14 +443,14 @@ SET (H5O_SRCS ${HDF5_SRC_DIR}/H5Ounknown.c ) -SET (H5O_HDRS +set (H5O_HDRS ${HDF5_SRC_DIR}/H5Opkg.h ${HDF5_SRC_DIR}/H5Opublic.h ${HDF5_SRC_DIR}/H5Oshared.h ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) -SET (H5P_SRCS +set (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c ${HDF5_SRC_DIR}/H5Pdapl.c @@ -471,50 +471,50 @@ SET (H5P_SRCS ${HDF5_SRC_DIR}/H5Ptest.c ) -SET (H5P_HDRS +set (H5P_HDRS ${HDF5_SRC_DIR}/H5Ppkg.h ${HDF5_SRC_DIR}/H5Ppublic.h ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) -SET (H5PL_SRCS +set (H5PL_SRCS ${HDF5_SRC_DIR}/H5PL.c ) -SET (H5PL_HDRS +set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) -SET (H5R_SRCS +set (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c ${HDF5_SRC_DIR}/H5Rdeprec.c ) -SET (H5R_HDRS +set (H5R_HDRS ${HDF5_SRC_DIR}/H5Rpkg.h ${HDF5_SRC_DIR}/H5Rpublic.h ) IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" ) -SET (H5UC_SRCS +set (H5UC_SRCS ${HDF5_SRC_DIR}/H5UC.c ) -SET (H5UC_HDRS +set (H5UC_HDRS ) IDE_GENERATED_PROPERTIES ("H5UC" "${H5UC_HDRS}" "${H5UC_SRCS}" ) -SET (H5RS_SRCS +set (H5RS_SRCS ${HDF5_SRC_DIR}/H5RS.c ) -SET (H5RS_HDRS +set (H5RS_HDRS ) IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" ) -SET (H5S_SRCS +set (H5S_SRCS ${HDF5_SRC_DIR}/H5S.c ${HDF5_SRC_DIR}/H5Sall.c ${HDF5_SRC_DIR}/H5Sdbg.c @@ -526,22 +526,22 @@ SET (H5S_SRCS ${HDF5_SRC_DIR}/H5Stest.c ) -SET (H5S_HDRS +set (H5S_HDRS ${HDF5_SRC_DIR}/H5Spkg.h ${HDF5_SRC_DIR}/H5Spublic.h ) IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) -SET (H5SL_SRCS +set (H5SL_SRCS ${HDF5_SRC_DIR}/H5SL.c ) -SET (H5SL_HDRS +set (H5SL_HDRS ) IDE_GENERATED_PROPERTIES ("H5SL" "${H5SL_HDRS}" "${H5SL_SRCS}" ) -SET (H5SM_SRCS +set (H5SM_SRCS ${HDF5_SRC_DIR}/H5SM.c ${HDF5_SRC_DIR}/H5SMbtree2.c ${HDF5_SRC_DIR}/H5SMcache.c @@ -549,21 +549,21 @@ SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SMtest.c ) -SET (H5SM_HDRS +set (H5SM_HDRS ${HDF5_SRC_DIR}/H5SMpkg.h ) IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) -SET (H5ST_SRCS +set (H5ST_SRCS ${HDF5_SRC_DIR}/H5ST.c ) -SET (H5ST_HDRS +set (H5ST_HDRS ) IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SRCS}" ) -SET (H5T_SRCS +set (H5T_SRCS ${HDF5_SRC_DIR}/H5T.c ${HDF5_SRC_DIR}/H5Tarray.c ${HDF5_SRC_DIR}/H5Tbit.c @@ -589,38 +589,38 @@ SET (H5T_SRCS ${HDF5_SRC_DIR}/H5Tvlen.c ) -SET (H5T_HDRS +set (H5T_HDRS ${HDF5_SRC_DIR}/H5Tpkg.h ${HDF5_SRC_DIR}/H5Tpublic.h ) IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) -SET (H5TS_SRCS +set (H5TS_SRCS ${HDF5_SRC_DIR}/H5TS.c ) -SET (H5TS_HDRS +set (H5TS_HDRS ) IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SRCS}" ) -SET (H5VM_SRCS +set (H5VM_SRCS ${HDF5_SRC_DIR}/H5VM.c ) -SET (H5VM_HDRS +set (H5VM_HDRS ) IDE_GENERATED_PROPERTIES ("H5VM" "${H5VM_HDRS}" "${H5VM_SRCS}" ) -SET (H5WB_SRCS +set (H5WB_SRCS ${HDF5_SRC_DIR}/H5WB.c ) -SET (H5WB_HDRS +set (H5WB_HDRS ) IDE_GENERATED_PROPERTIES ("H5WB" "${H5WB_HDRS}" "${H5WB_SRCS}" ) -SET (H5Z_SRCS +set (H5Z_SRCS ${HDF5_SRC_DIR}/H5Z.c ${HDF5_SRC_DIR}/H5Zdeflate.c ${HDF5_SRC_DIR}/H5Zfletcher32.c @@ -630,19 +630,19 @@ SET (H5Z_SRCS ${HDF5_SRC_DIR}/H5Zszip.c ${HDF5_SRC_DIR}/H5Ztrans.c ) -IF (H5_ZLIB_HEADER) +if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -ENDIF (H5_ZLIB_HEADER) +endif (H5_ZLIB_HEADER) -SET (H5Z_HDRS +set (H5Z_HDRS ${HDF5_SRC_DIR}/H5Zpkg.h ${HDF5_SRC_DIR}/H5Zpublic.h ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) -SET (common_SRCS +set (common_SRCS ${H5_SRCS} ${H5A_SRCS} ${H5AC_SRCS} @@ -686,7 +686,7 @@ SET (common_SRCS ${H5Z_SRCS} ) -SET (H5_PUBLIC_HEADERS +set (H5_PUBLIC_HEADERS ${H5_HDRS} ${H5A_HDRS} ${H5AC_HDRS} @@ -720,7 +720,7 @@ SET (H5_PUBLIC_HEADERS ) -SET (H5_PRIVATE_HEADERS +set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h ${HDF5_SRC_DIR}/H5Aprivate.h ${HDF5_SRC_DIR}/H5ACprivate.h @@ -766,35 +766,32 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5win32defs.h ) -INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) - #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5detect "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5detect>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5detect>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) -ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5make_libsettings "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5make_libsettings>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5make_libsettings>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c @@ -802,21 +799,21 @@ ADD_CUSTOM_COMMAND ( WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5Edefin.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt COMMENT " Creating err headers" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5version.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt COMMENT " Creating API version macro" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5overflow.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt @@ -826,51 +823,64 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time #----------------------------------------------------------------------------- -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) - -ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) + +add_library (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) -IF (NOT WIN32) - TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) -ENDIF (NOT WIN32) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +if (NOT WIN32) + target_link_libraries (${HDF5_LIB_TARGET} dl) +endif (NOT WIN32) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) +set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + FOLDER libraries + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) + +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 + "-DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG + -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG + -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG + -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG" + ) +endif (HDF5_ENABLE_DEBUG_APIS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${H5_PUBLIC_HEADERS} - ${H5_PRIVATE_HEADERS} DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_LIB_TARGET} EXPORT @@ -879,4 +889,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 254797d..ff975f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,44 +4,44 @@ PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- -SET (TEST_LIB_SRCS +set (TEST_LIB_SRCS ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c ) -SET (TEST_LIB_HEADERS +set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +add_library (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -ENDIF (MSVC) -IF (MINGW) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -ENDIF (MINGW) -TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +if (MSVC) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") +endif (MSVC) +if (MINGW) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") +endif (MINGW) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) +set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) # make plugins dir FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") @@ -49,36 +49,36 @@ IF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- - SET (TEST_PLUGIN_LIBS + set (TEST_PLUGIN_LIBS dynlib1 dynlib3 ) - SET (TEST2_PLUGIN_LIBS + set (TEST2_PLUGIN_LIBS dynlib2 ) - FOREACH (test_lib ${TEST_PLUGIN_LIBS}) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + foreach (test_lib ${TEST_PLUGIN_LIBS}) + set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} ${LIB_TYPE} HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -86,30 +86,30 @@ IF (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) + endforeach (test_lib ${TEST_PLUGIN_LIBS}) - FOREACH (test_lib ${TEST2_PLUGIN_LIBS}) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + foreach (test_lib ${TEST2_PLUGIN_LIBS}) + set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} ${LIB_TYPE} HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -117,10 +117,10 @@ IF (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - ENDFOREACH (test_lib ${TEST2_PLUGIN_LIBS}) -ENDIF (BUILD_SHARED_LIBS) + endforeach (test_lib ${TEST2_PLUGIN_LIBS}) +endif (BUILD_SHARED_LIBS) -SET (testhdf5_SRCS +set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c ${HDF5_TEST_SOURCE_DIR}/tattr.c @@ -149,21 +149,21 @@ SET (testhdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) +add_executable (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") -TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (testhdf5 PROPERTIES FOLDER test) MACRO (ADD_H5_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${file} PROPERTIES FOLDER test) ENDMACRO (ADD_H5_EXE file) -SET (H5_TESTS +set (H5_TESTS accum lheap ohdr @@ -221,9 +221,9 @@ SET (H5_TESTS unregister ) -FOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -ENDFOREACH (test ${H5_TESTS}) +endforeach (test ${H5_TESTS}) ############################################################################## ############################################################################## @@ -232,28 +232,28 @@ ENDFOREACH (test ${H5_TESTS}) ############################################################################## #-- Adding test for cache -ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) TARGET_C_PROPERTIES (cache " " " ") -TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) +target_link_libraries (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache PROPERTIES FOLDER test) #-- Adding test for cache_api -ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_api " " " ") -TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) +target_link_libraries (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_api PROPERTIES FOLDER test) #-- Adding test for cache_tagging -ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_tagging " " " ") -TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) +target_link_libraries (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_tagging PROPERTIES FOLDER test) #-- Adding test for ttsafe -ADD_EXECUTABLE (ttsafe +add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c @@ -262,53 +262,53 @@ ADD_EXECUTABLE (ttsafe ) TARGET_NAMING (ttsafe ${LIB_TYPE}) TARGET_C_PROPERTIES (ttsafe " " " ") -TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) +target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (ttsafe PROPERTIES FOLDER test) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + add_executable (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) TARGET_C_PROPERTIES (err_compat " " " ") - TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + target_link_libraries (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (err_compat PROPERTIES FOLDER test) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test -ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) +add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) TARGET_C_PROPERTIES (error_test " " " ") -TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) +target_link_libraries (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (error_test PROPERTIES FOLDER test) #-- Adding test for links_env -ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) +add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) TARGET_C_PROPERTIES (links_env " " " ") -TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) +target_link_libraries (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo -SET (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) FILE (WRITE ${GREP_RUNNER} "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") -IF (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -ELSE (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (STATUS \"COMMAND Result: \${TEST_RESULT}\") -ENDIF (\${TEST_RESULT} STREQUAL \"0\") +if (\${TEST_RESULT} STREQUAL \"0\") + message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") +else (\${TEST_RESULT} STREQUAL \"0\") + message (STATUS \"COMMAND Result: \${TEST_RESULT}\") +endif (\${TEST_RESULT} STREQUAL \"0\") " ) ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) - ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) +if (BUILD_SHARED_LIBS) + add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin ${LIB_TYPE}) TARGET_C_PROPERTIES (plugin " " " ") - TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) - SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) -ENDIF (BUILD_SHARED_LIBS) + target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + set_target_properties (plugin PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1b80e67..dbfe489 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -8,25 +8,25 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES tnullspace.h5 ) -FOREACH (h5_tfile ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") - #MESSAGE (STATUS " Copying ${h5_tfile}") - ADD_CUSTOM_COMMAND ( +foreach (h5_tfile ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") + #message (STATUS " Copying ${h5_tfile}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} ) -ENDFOREACH (h5_tfile ${HDF5_TEST_FILES}) +endforeach (h5_tfile ${HDF5_TEST_FILES}) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_FILES +set (HDF5_REFERENCE_FILES err_compat_1 err_compat_2 error_test_1 @@ -34,21 +34,21 @@ SET (HDF5_REFERENCE_FILES links_env.out ) -FOREACH (ref_file ${HDF5_REFERENCE_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${ref_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (ref_file ${HDF5_REFERENCE_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${ref_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} ) -ENDFOREACH (ref_file ${HDF5_REFERENCE_FILES}) +endforeach (ref_file ${HDF5_REFERENCE_FILES}) # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_PLIST_FILES +set (HDF5_REFERENCE_PLIST_FILES acpl_be acpl_le dapl_be @@ -75,21 +75,21 @@ SET (HDF5_REFERENCE_PLIST_FILES strcpl_le ) -FOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${plistfile}") - #MESSAGE (STATUS " Copying ${plistfile} to ${dset}") - ADD_CUSTOM_COMMAND ( +foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${plistfile}") + #message (STATUS " Copying ${plistfile} to ${dset}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile} ${dest} ) -ENDFOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) +endforeach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_TEST_FILES +set (HDF5_REFERENCE_TEST_FILES be_data.h5 be_extlink1.h5 be_extlink2.h5 @@ -125,16 +125,16 @@ SET (HDF5_REFERENCE_TEST_FILES tsizeslheap.h5 ) -FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file} to ${dest}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) +endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) # Remove any output file left over from previous test run ADD_TEST ( @@ -160,7 +160,7 @@ ADD_TEST ( tsohm_src.h5 ) -IF (HDF5_ENABLE_USING_MEMCHECKER) +if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) @@ -173,10 +173,10 @@ IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) -ELSE (HDF5_ENABLE_USING_MEMCHECKER) +else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>) SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) -ENDIF (HDF5_ENABLE_USING_MEMCHECKER) +endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## @@ -248,10 +248,10 @@ ADD_TEST ( unregister_filter_2.h5 ) -FOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) ADD_TEST (NAME ${test} COMMAND $<TARGET_FILE:${test}>) SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects) -ENDFOREACH (test ${H5_TESTS}) +endforeach (test ${H5_TESTS}) SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) @@ -306,7 +306,7 @@ ADD_TEST (NAME ttsafe COMMAND $<TARGET_FILE:ttsafe>) SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_TEST ( NAME h5test-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} @@ -325,7 +325,7 @@ IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES(err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_TEST ( @@ -378,23 +378,23 @@ ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FI ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) SET(CMAKE_SEP "\;") - ELSE (WIN32 AND NOT CYGWIN) + else (WIN32 AND NOT CYGWIN) SET(CMAKE_SEP ":") ENDIF(WIN32 AND NOT CYGWIN) ADD_TEST (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") ADD_TEST ( NAME H5PLUGIN-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -402,9 +402,9 @@ ENDIF (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -413,7 +413,7 @@ IF (HDF5_TEST_VFD) family ) - SET (H5_VFD_TESTS + set (H5_VFD_TESTS testhdf5 accum lheap @@ -469,12 +469,12 @@ IF (HDF5_TEST_VFD) unregister ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - FOREACH (test ${H5_VFD_TESTS}) + foreach (test ${H5_VFD_TESTS}) ADD_TEST ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" @@ -486,8 +486,8 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5_VFD_TESTS}) - IF (HDF5_TEST_FHEAP_VFD) + endforeach (test ${H5_VFD_TESTS}) + if (HDF5_TEST_FHEAP_VFD) ADD_TEST ( NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -499,15 +499,15 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDIF (HDF5_TEST_FHEAP_VFD) + endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) ############################################################################## ############################################################################## @@ -515,17 +515,17 @@ ENDIF (HDF5_TEST_VFD) ############################################################################## ############################################################################## -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) - ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) + add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) TARGET_C_PROPERTIES (${genfile} " " " ") - TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) + target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables - SET (H5_GENERATORS + set (H5_GENERATORS gen_bad_ohdr gen_bogus gen_cross @@ -547,8 +547,8 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) gen_plist ) - FOREACH (gen ${H5_GENERATORS}) + foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - ENDFOREACH (gen ${H5_GENERATORS}) + endforeach (gen ${H5_GENERATORS}) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 30cdcda..8eaa13a 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) @@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Define Tests #----------------------------------------------------------------------------- -SET (testphdf5_SRCS +set (testphdf5_SRCS ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c @@ -27,21 +27,21 @@ SET (testphdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testphdf5 " " " ") -TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) -SET (H5P_TESTS +set (H5P_TESTS t_mpi # t_posix_compliant t_cache @@ -50,12 +50,12 @@ SET (H5P_TESTS t_shapesame ) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) -IF (NOT WIN32) +if (NOT WIN32) ADD_H5P_EXE(t_posix_compliant) -ENDIF (NOT WIN32) +endif (NOT WIN32) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index bc8fc90..6e1f823 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -7,19 +7,19 @@ ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_TEST (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${testp}>) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) -IF (NOT WIN32) +if (NOT WIN32) ADD_TEST (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:t_posix_compliant>) -ENDIF (NOT WIN32) +endif (NOT WIN32) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -28,18 +28,18 @@ IF (HDF5_TEST_VFD) family ) - SET (H5P_VFD_TESTS + set (H5P_VFD_TESTS t_pflush1 t_pflush2 ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - FOREACH (test ${H5P_VFD_TESTS}) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + foreach (test ${H5P_VFD_TESTS}) ADD_TEST ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" @@ -51,13 +51,13 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5P_VFD_TESTS}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endforeach (test ${H5P_VFD_TESTS}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3bb4a1f..0dfe7c9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -14,9 +14,9 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -IF (NOT BUILD_TESTING) +if (NOT BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) -ENDIF (NOT BUILD_TESTING) +endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..79deec9 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -9,27 +9,27 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copy " " " ") -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) +target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5copy PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5copy) +set (H5_DEP_EXECUTABLES h5copy) -IF (BUILD_TESTING) - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) +if (BUILD_TESTING) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copygentest " " " ") - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5copy RUNTIME DESTINATION diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a4cce03..0d8f121 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -8,30 +8,30 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles}") + add_custom_command ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_F-${testname}-clear-objects @@ -51,35 +51,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_F-${testname} COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY_F-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -87,35 +87,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -123,19 +123,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} @@ -143,20 +143,20 @@ ) SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_SAME-${testname}-clear-objects @@ -164,19 +164,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_SAME-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_SAME-${testname} @@ -184,16 +184,16 @@ ) SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST_SAME) # @@ -202,15 +202,15 @@ # MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-CMP-${testname}-clear-objects @@ -233,7 +233,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -245,12 +245,12 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + set (HDF_FILE1 h5copytst) + set (HDF_FILE2 h5copy_ref) + set (HDF_EXT_SRC_FILE h5copy_extlinks_src) + set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-clearall-objects @@ -292,11 +292,11 @@ h5copy_misc1.out.out.err ) SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5COPY-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d79c290..3ef108b 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -9,45 +9,45 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5diff executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5diff +add_executable (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diff " " " ") -TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) +target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5diff PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5diff) +set (H5_DEP_EXECUTABLES h5diff) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5diff +if (H5_HAVE_PARALLEL) + add_executable (ph5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5diff " " " ") - TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (ph5diff PROPERTIES FOLDER tools) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diffgentest " " " ") - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -61,7 +61,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5diff RUNTIME DESTINATION @@ -70,11 +70,11 @@ INSTALL ( toolsapplications ) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL ( + install ( TARGETS ph5diff RUNTIME DESTINATION @@ -82,4 +82,4 @@ IF (H5_HAVE_PARALLEL) COMPONENT toolsapplications ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index cac4f84..f13f689 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 @@ -52,7 +52,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt @@ -239,50 +239,50 @@ # # copy test files from source to build dir # - FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${fname}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${fname}") + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_tstfiles} ${dest} ) - ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) # # Overwrite system dependent files (Windows) # - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + if (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -292,16 +292,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -320,24 +320,24 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (H5_HAVE_PARALLEL) + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - ENDIF (H5_HAVE_PARALLEL) + endif (H5_HAVE_PARALLEL) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -358,7 +358,7 @@ -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) # ADD_H5_NO_OUTPUT_TEST @@ -366,30 +366,30 @@ # Don't use this if possible; this may be removed. MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # if there was a previous test - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") + endif (NOT ${resultcode} STREQUAL "0") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## @@ -401,54 +401,54 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (FILE1 h5diff_basic1.h5) - SET (FILE2 h5diff_basic2.h5) - SET (FILE3 h5diff_types.h5) - SET (FILE4 h5diff_dtypes.h5) - SET (FILE5 h5diff_attr1.h5) - SET (FILE6 h5diff_attr2.h5) - SET (FILE7 h5diff_dset1.h5) - SET (FILE8 h5diff_dset2.h5) - SET (FILE9 h5diff_hyper1.h5) - SET (FILE10 h5diff_hyper2.h5) - SET (FILE11 h5diff_empty.h5) - SET (FILE12 h5diff_links.h5) - SET (FILE13 h5diff_softlinks.h5) - SET (FILE14 h5diff_linked_softlink.h5) - SET (FILE15 h5diff_extlink_src.h5) - SET (FILE16 h5diff_extlink_trg.h5) - SET (FILE17 h5diff_ext2softlink_src.h5) - SET (FILE18 h5diff_ext2softlink_trg.h5) - SET (FILE19 h5diff_dset_zero_dim_size1.h5) - SET (FILE20 h5diff_dset_zero_dim_size2.h5) - SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) - SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) - SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) - SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + set (FILE1 h5diff_basic1.h5) + set (FILE2 h5diff_basic2.h5) + set (FILE3 h5diff_types.h5) + set (FILE4 h5diff_dtypes.h5) + set (FILE5 h5diff_attr1.h5) + set (FILE6 h5diff_attr2.h5) + set (FILE7 h5diff_dset1.h5) + set (FILE8 h5diff_dset2.h5) + set (FILE9 h5diff_hyper1.h5) + set (FILE10 h5diff_hyper2.h5) + set (FILE11 h5diff_empty.h5) + set (FILE12 h5diff_links.h5) + set (FILE13 h5diff_softlinks.h5) + set (FILE14 h5diff_linked_softlink.h5) + set (FILE15 h5diff_extlink_src.h5) + set (FILE16 h5diff_extlink_trg.h5) + set (FILE17 h5diff_ext2softlink_src.h5) + set (FILE18 h5diff_ext2softlink_trg.h5) + set (FILE19 h5diff_dset_zero_dim_size1.h5) + set (FILE20 h5diff_dset_zero_dim_size2.h5) + set (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + set (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + set (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + set (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) # group recursive - same structure via external links through files - SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) - SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) - SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) - SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + set (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + set (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + set (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + set (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) # same structure, same obj name with different value - SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) - SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + set (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + set (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) # different structure and obj names - SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) - SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + set (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + set (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) # Only one file contains unique objs. Common objs are same. - SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) - SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) + set (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + set (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) # compound type with multiple vlen string types - SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + set (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) # container types (array,vlen) with multiple nested compound types - SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) - SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) + set (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + set (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) # attrs with verbose option level - SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) - SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) + set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DIFF-clearall-objects @@ -802,11 +802,11 @@ h5diff_90.out.err ) SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DIFF-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -1074,7 +1074,7 @@ ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) # 10. read by hyperslab, print indexes #if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then # # skip this test which sometimes hangs in some THG machines -# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +# message (STATUS "SKIP -v ${FILE9} ${FILE10}) #else # ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) #fi diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 30ff215..ce162ad 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -9,38 +9,38 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5dump +add_executable (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dump " " " ") -TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) +target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5dump PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5dump) +set (H5_DEP_EXECUTABLES h5dump) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dumpgentest " " " ") - TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) - INCLUDE (CMakeTestsPBITS.cmake) + include (CMakeTestsPBITS.cmake) - INCLUDE (CMakeTestsXML.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTestsXML.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -54,7 +54,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5dump RUNTIME DESTINATION diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 13c3d41..486b21c 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl @@ -173,7 +173,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ) - SET (HDF5_REFERENCE_EXP_FILES + set (HDF5_REFERENCE_EXP_FILES tall-6.exp tnoddlfile.exp trawdatafile.exp @@ -183,7 +183,7 @@ twithddl.exp twithddlfile.exp ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 @@ -280,7 +280,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 ) - SET (HDF5_ERROR_REFERENCE_TEST_FILES + set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err @@ -312,77 +312,77 @@ # # copy test files from source dir to test dir # - FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_h5_file} ${dest} ) - ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - IF (WIN32 AND NOT CYGWIN) + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} ) - ENDIF (WIN32 AND NOT CYGWIN) - ENDFOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + endif (WIN32 AND NOT CYGWIN) + endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - FOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + foreach (tst_other_file ${HDF5_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_other_file} ${dest} ) - ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) - FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_error_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_error_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_error_file} ${dest} ) - ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - IF (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -392,14 +392,14 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -418,34 +418,34 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_SKIP_H5_TEST) MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -464,21 +464,21 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -497,21 +497,21 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_N file) MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -537,21 +537,21 @@ ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -584,11 +584,11 @@ ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-output-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -608,11 +608,11 @@ ) SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -632,11 +632,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -657,11 +657,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -684,12 +684,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -714,7 +714,7 @@ ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_IMPORT file) ############################################################################## @@ -723,7 +723,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP-clearall-objects @@ -1053,11 +1053,11 @@ zerodim.out.err ) SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_HELP_TEST(help 0 -h) @@ -1326,38 +1326,38 @@ # filters are defined. # detect whether the encoder is present. - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) - IF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + if (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # data read internal filters ADD_H5_TEST (treadintfilter 0 --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5) - IF (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - ENDIF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + endif (HDF5_ENABLE_SZIP_SUPPORT) + endif (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1390,16 +1390,16 @@ # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index baa1705..3a279b5 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -9,7 +9,7 @@ # Packed Bits # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory - SET (HDF5_REFERENCE_PBITS + set (HDF5_REFERENCE_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl @@ -64,12 +64,12 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl ) - SET (HDF5_REFERENCE_TEST_PBITS + set (HDF5_REFERENCE_TEST_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 ) - SET (HDF5_ERROR_REFERENCE_PBITS + set (HDF5_ERROR_REFERENCE_PBITS ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err @@ -85,42 +85,42 @@ ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err ) - FOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) GET_FILENAME_COMPONENT(fname "${pbits_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${pbits_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${pbits_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${pbits_h5_file} ${dest} ) - ENDFOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) - FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) - FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) ############################################################################## ############################################################################## @@ -130,16 +130,16 @@ MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_pbits_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_pbits_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_pbits_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -158,7 +158,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) ############################################################################## @@ -167,7 +167,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP_PACKED_BITS-clearall-objects @@ -281,11 +281,11 @@ tpbitsUnsignedLongLong16.out.err ) SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_pbits_test}" STREQUAL "") + if (NOT "${last_pbits_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_pbits_test}" STREQUAL "") + set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling # Missing file name diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 6c9cae1..ce7fdf7 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -8,7 +8,7 @@ # # copy XML test files from source dir to test dir # - SET (HDF5_XML_REFERENCE_TEST_FILES + set (HDF5_XML_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 @@ -61,7 +61,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5 ) - SET (HDF5_XML_REFERENCE_FILES + set (HDF5_XML_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml @@ -127,29 +127,29 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml ) - FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} ) - ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) - FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_other_file} ${dest} ) - ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) ############################################################################## ############################################################################## @@ -158,29 +158,29 @@ ############################################################################## MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_XML_SKIP_H5_TEST) MACRO (ADD_XML_H5_TEST resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_xml_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_xml_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_xml_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -199,7 +199,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) ############################################################################## @@ -208,7 +208,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP-XML-clearall-objects @@ -344,11 +344,11 @@ tvlstr.h5.out.err ) SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_xml_test}" STREQUAL "") + if (NOT "${last_xml_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_xml_test}" STREQUAL "") + set (last_test "H5DUMP-XML-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -413,10 +413,10 @@ # The lone colon here confuses some systems (Cray X1). Skip # it if configure detects that this is a problem. - SET (TESTTYPE "TEST") - IF (NOT "H5_LONE_COLON") - SET (TESTTYPE "SKIP") - ENDIF (NOT "H5_LONE_COLON") + set (TESTTYPE "TEST") + if (NOT "H5_LONE_COLON") + set (TESTTYPE "SKIP") + endif (NOT "H5_LONE_COLON") ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7caf44a..32dff55 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -9,28 +9,28 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +add_executable (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_C_PROPERTIES (h5import " " " ") -TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) -SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) +target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +set_target_properties (h5import PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5import) +set (H5_DEP_EXECUTABLES h5import) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + add_executable (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5importtest " " " ") - TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) + target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5importtest PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -44,7 +44,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5import RUNTIME DESTINATION diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 96cca87..3250910 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_CONF_FILES + set (HDF5_REFERENCE_CONF_FILES binfp64.conf binin8.conf binin8w.conf @@ -23,7 +23,7 @@ textpfe.conf txtstr.conf ) - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES txtfp32.txt txtfp64.txt txtuin16.txt @@ -42,7 +42,7 @@ dbinuin32.h5.txt dtxtstr.h5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES binfp64.h5 binin8.h5 binin8w.h5 @@ -62,38 +62,38 @@ ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") - #MESSAGE (STATUS " Copying ${conf_file}") - ADD_CUSTOM_COMMAND ( + foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") + #message (STATUS " Copying ${conf_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} ) - ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -102,12 +102,12 @@ ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -149,12 +149,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -170,7 +170,7 @@ ) SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - IF ("${ARGN}" STREQUAL "BINARY") + if ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -182,7 +182,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ELSE ("${ARGN}" STREQUAL "BINARY") + else ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -194,7 +194,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF ("${ARGN}" STREQUAL "BINARY") + endif ("${ARGN}" STREQUAL "BINARY") SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") ADD_TEST ( @@ -223,24 +223,24 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) ############################################################################## ############################################################################## @@ -248,7 +248,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5IMPORT-clear-objects @@ -406,8 +406,8 @@ dtxtstr.h5.dff dtxtstr.h5.dff.err ) - SET (last_test "H5IMPORT-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set (last_test "H5IMPORT-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-h5importtest-clear-objects @@ -421,10 +421,10 @@ binuin16.bin binuin32.bin ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5IMPORT-clear-objects") ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) @@ -452,19 +452,19 @@ # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 49d1b0c..a17bf45 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -9,54 +9,54 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +add_executable (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5jam " " " ") -TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) +target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5jam PROPERTIES FOLDER tools) -ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +add_executable (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) TARGET_C_PROPERTIES (getub " " " ") -TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) +target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (getub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +add_executable (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_C_PROPERTIES (tellub " " " ") -TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) +target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (tellub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +add_executable (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5unjam " " " ") -TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) +target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5unjam PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5jam getub tellub h5unjam ) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -70,7 +70,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5jam h5unjam RUNTIME DESTINATION diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 3816e85..123c26f 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES u10.txt u511.txt u512.txt @@ -14,34 +14,34 @@ h5unjam-help.txt h5jam-ub-nohdf5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES tall.h5 twithub.h5 twithub513.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) ############################################################################## ############################################################################## @@ -55,12 +55,12 @@ # MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -80,7 +80,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) # ============================================================ @@ -89,12 +89,12 @@ # MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -114,12 +114,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} @@ -156,11 +156,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname testdepends expected actual) MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${infile} @@ -175,7 +175,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) - IF (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${ufile}" STREQUAL "NONE") ADD_TEST ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ufile} @@ -183,9 +183,9 @@ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") + set (compare_test ${ufile}) + else (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${ARGN}" STREQUAL "--delete") ADD_TEST ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err @@ -203,14 +203,14 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") + set (compare_test "${outfile}.ufile.txt") + else (NOT "${ARGN}" STREQUAL "--delete") ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${compare_test}" STREQUAL "") + set (compare_test "") + endif (NOT "${ARGN}" STREQUAL "--delete") + endif (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${compare_test}" STREQUAL "") ADD_TEST ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} @@ -234,7 +234,7 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - ENDIF (NOT "${compare_test}" STREQUAL "") + endif (NOT "${compare_test}" STREQUAL "") ADD_TEST ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB @@ -249,31 +249,31 @@ -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${compare_test}" STREQUAL "") + if (NOT "${compare_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - ELSE (NOT "${compare_test}" STREQUAL "") + else (NOT "${compare_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - ENDIF (NOT "${compare_test}" STREQUAL "") + endif (NOT "${compare_test}" STREQUAL "") CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) MACRO (JAMTEST testname jamfile infile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") + set (compare_test ${outfile}) + set (compare_orig testfiles/${infile}) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") ADD_TEST ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects @@ -299,11 +299,11 @@ ) SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}_NONE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -324,11 +324,11 @@ ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) - SET (compare_test ${chkfile}) - SET (compare_orig ${chkfile}.cpy.h5) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") + set (compare_test ${chkfile}) + set (compare_orig ${chkfile}.cpy.h5) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") ADD_TEST ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects @@ -354,7 +354,7 @@ ) SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index eeaf1ea..b351268 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -9,21 +9,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- -ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_C_PROPERTIES (h5ls " " " ") -TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) +target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5ls PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5ls ) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -37,7 +37,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5ls RUNTIME DESTINATION diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 09f375d..b2d039f 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 @@ -33,7 +33,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls @@ -95,17 +95,17 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles} to ${dest}") + add_custom_command ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## @@ -116,16 +116,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -143,7 +143,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -152,7 +152,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5LS-clearall-objects @@ -265,11 +265,11 @@ tvldtypes2be.out tvldtypes2be.out.err ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5LS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -378,25 +378,25 @@ # test for attribute with region references wo verbose mode # ( HDFFV-7838, ) - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) # test for variable length data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for dataset region references data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 176fc2b..4625607 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Add h5Repack executables # -------------------------------------------------------------------- -SET (REPACK_COMMON_SRCS +set (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c @@ -20,43 +20,43 @@ SET (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c ) -ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repack " " " ") -TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) +target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5repack PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5repack) +set (H5_DEP_EXECUTABLES h5repack) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") - TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) + target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) - ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repacktest " " " ") - TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) + target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5repacktest PROPERTIES FOLDER tools) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - IF (BUILD_SHARED_LIBS) - SET (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - SET (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - SET (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} ${LIB_TYPE} @@ -69,7 +69,7 @@ IF (BUILD_TESTING) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -77,11 +77,11 @@ IF (BUILD_TESTING) "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" ) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -95,7 +95,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5repack RUNTIME DESTINATION diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 3252c30..6483a97 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -5,8 +5,8 @@ ############################################################################## ############################################################################## - IF (HDF5_TEST_VFD) - SET (VFD_LIST + if (HDF5_TEST_VFD) + set (VFD_LIST sec2 stdio core @@ -15,9 +15,9 @@ family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) ADD_TEST ( @@ -31,17 +31,17 @@ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 @@ -79,7 +79,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin @@ -93,17 +93,17 @@ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst ) - FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repack POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_file} ${dest} ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -113,14 +113,14 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN}) SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -139,72 +139,72 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_H5_TEST_OLD testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_TEST ( NAME H5REPACK_OLD-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) MACRO (ADD_H5_TEST testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_TEST ( NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_CMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -217,30 +217,30 @@ -D "TEST_REFERENCE=${resultfile}.tst" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (${testtype} STREQUAL "SKIP") + endif (NOT "${last_test}" STREQUAL "") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts ADD_TEST ( NAME H5REPACK_DMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -253,33 +253,33 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_DMP_TEST) MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - IF (${resultcode} STREQUAL "0") + if (${resultcode} STREQUAL "0") ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" @@ -293,16 +293,16 @@ -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ELSE (${resultcode} STREQUAL "0") - IF (${testfilter} STREQUAL "CHUNKED") - SET (nottestfilter "(CONTIGUOUS|COMPACT)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") + else (${resultcode} STREQUAL "0") + if (${testfilter} STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif (${testfilter} STREQUAL "CHUNKED") + if (${testfilter} STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif (${testfilter} STREQUAL "CONTIGUOUS") + if (${testfilter} STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") + endif (${testfilter} STREQUAL "COMPACT") ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" @@ -316,9 +316,9 @@ -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ENDIF (${resultcode} STREQUAL "0") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${resultcode} STREQUAL "0") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) MACRO (ADD_H5_TEST_META testname testfile) @@ -326,9 +326,9 @@ NAME H5REPACK_META-${testname}_N COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK_META-${testname}_M COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 @@ -341,7 +341,7 @@ ENDMACRO (ADD_H5_TEST_META) MACRO (ADD_H5_UD_TEST testname resultcode resultfile) - IF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5REPACK_UD-${testname}-clearall-objects @@ -382,7 +382,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - ENDIF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_UD_TEST) ############################################################################## @@ -394,27 +394,27 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) + set (INFO_FILE testfiles/h5repack.info) + + set (FILE0 h5repack_fill.h5) + set (FILE1 h5repack_objs.h5) + set (FILE2 h5repack_attr.h5) + set (FILE3 h5repack_hlink.h5) + set (FILE4 h5repack_layout.h5) + set (FILE5 h5repack_early.h5) + set (FILE7 h5repack_szip.h5) + set (FILE8 h5repack_deflate.h5) + set (FILE9 h5repack_shuffle.h5) + set (FILE10 h5repack_fletcher.h5) + set (FILE11 h5repack_filters.h5) + set (FILE12 h5repack_nbit.h5) + set (FILE13 h5repack_soffset.h5) + set (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + set (FILE15 h5repack_named_dtypes.h5) + set (FILE16 tfamily%05d.h5) # located in common testfiles folder + set (FILE18 h5repack_layout2.h5) + set (FILE_REF h5repack_refs.h5) + set (FILE_ATTR_REF h5repack_attr_refs.h5) # Remove any output file left over from previous test run ADD_TEST ( @@ -597,30 +597,30 @@ h5repack_ext.bin ublock.bin ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") + if (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "yes") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") + else (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") + endif (HDF5_ENABLE_SZIP_ENCODING) + else (HDF5_ENABLE_SZIP_SUPPORT) + set (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + endif (HDF5_ENABLE_SZIP_SUPPORT) SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - SET (last_test "H5REPACK-h5repacktest") + set (last_test "H5REPACK-h5repacktest") # # The tests @@ -636,34 +636,34 @@ # filters are defined. # detect whether the encoder is present. - SET (USE_FILTER_SZIP_ENCODER "no") - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) - - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) - - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) - - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) - - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SZIP_ENCODER "no") + if (HDF5_ENABLE_SZIP_ENCODING) + set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + endif (HDF5_ENABLE_SZIP_ENCODING) + + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) + + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) + + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) + + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) + + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -676,83 +676,83 @@ # use $FILE4 to write some filters (this file has no filters) # gzip with individual object - SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all - SET (arg ${FILE4} -f GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object - SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all - SET (arg ${FILE4} -f SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object - SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) # shuffle for all - SET (arg ${FILE4} -f SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) # fletcher32 with individual object - SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) # fletcher32 for all - SET (arg ${FILE4} -f FLET) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f FLET) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) # all filters - SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object - SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -760,154 +760,154 @@ ########################################################### # szip copy - SET (arg ${FILE7}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove - SET (arg ${FILE7} --filter=dset_szip:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7} --filter=dset_szip:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy - SET (arg ${FILE8}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove - SET (arg ${FILE8} -f dset_deflate:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy - SET (arg ${FILE9}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) # shuffle remove - SET (arg ${FILE9} -f dset_shuffle:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9} -f dset_shuffle:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) # fletcher32 copy - SET (arg ${FILE10}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) # fletcher32 remove - SET (arg ${FILE10} -f dset_fletcher32:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10} -f dset_fletcher32:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) # nbit copy - SET (arg ${FILE12}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) # nbit remove - SET (arg ${FILE12} -f dset_nbit:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_nbit:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) # nbit add - SET (arg ${FILE12} -f dset_int31:NBIT) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_int31:NBIT) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) # scaleoffset copy - SET (arg ${FILE13}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) # scaleoffset add - SET (arg ${FILE13} -f dset_none:SOFF=31,IN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_none:SOFF=31,IN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) # scaleoffset remove - SET (arg ${FILE13} -f dset_scaleoffset:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_scaleoffset:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) # remove all filters - SET (arg ${FILE11} -f NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE11} -f NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions - SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - SET (arg ${FILE7} -f dset_szip:GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE7} -f dset_szip:GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit - SET (arg ${FILE4} -f GZIP=1 -m 1024) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1 -m 1024) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file - SET (arg ${FILE4} -e ${INFO_FILE}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -e ${INFO_FILE}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -990,44 +990,44 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters - SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} --filter GZIP=1 --filter SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "LEGACY") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "LEGACY") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file - SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + set (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) ADD_H5_TEST (add_userblock "TEST" ${arg}) # add alignment - SET (arg ${FILE1} -t 1 -a 1) + set (arg ${FILE1} -t 1 -a 1) ADD_H5_TEST (add_alignment "TEST" ${arg}) # Check repacking file with old version of layout message (should get upgraded @@ -1064,20 +1064,20 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") ADD_TEST ( NAME H5REPACK-plugin COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) - IF (HDF5_TEST_VFD) + if (HDF5_TEST_VFD) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) + endforeach (vfd ${VFD_LIST}) + endif (HDF5_TEST_VFD) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 6086fc2..a97be07 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -9,30 +9,30 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat " " " ") -TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) +target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5stat PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5stat) +set (H5_DEP_EXECUTABLES h5stat) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat_gentest " " " ") - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -46,7 +46,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5stat RUNTIME DESTINATION diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 81ddf82..4ae9ff7 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl h5stat_notexist.ddl @@ -41,34 +41,34 @@ h5stat_numattrs3.ddl h5stat_numattrs4.ddl ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 h5stat_tsohm.h5 h5stat_newgrat.h5 h5stat_threshold.h5 ) - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") - ADD_CUSTOM_COMMAND ( + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #message (STATUS " Translating ${ddl_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -78,15 +78,15 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -104,7 +104,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -113,7 +113,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5STAT-clearall-objects @@ -182,11 +182,11 @@ h5stat_numattrs4.out h5stat_numattrs4.out.err ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5STAT-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 43ef6ba..5569b6f 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (H5_TOOLS_LIB_SRCS +set (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_array.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_attr.c @@ -26,7 +26,7 @@ SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c ) -SET (H5_TOOLS_LIB_HDRS +set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h @@ -36,18 +36,18 @@ SET (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h ) -ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +add_library (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) +#set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## @@ -58,7 +58,7 @@ SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tool #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION @@ -71,26 +71,26 @@ INSTALL ( # Because tools are installed into bin/tools we need to make sure the hdf5tools # library will be installed into the proper location. #----------------------------------------------------------------------------- -IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) +if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) -ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) +endif (APPLE) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_TOOLS_LIB_TARGET} EXPORT @@ -99,4 +99,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 8e1003e..c1f7454 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -10,25 +10,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables -ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_C_PROPERTIES (h5debug " " " ") -TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) +target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5debug PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart " " " ") -TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) +target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_C_PROPERTIES (h5mkgrp " " " ") -TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) +target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5mkgrp PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5debug h5repart h5mkgrp @@ -37,31 +37,31 @@ SET (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Generate the h5cc file containing settings needed to compile programs #----------------------------------------------------------------------------- -#IF (NOT WIN32) +#if (NOT WIN32) # CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#ENDIF (NOT WIN32) +#endif (NOT WIN32) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_gentest " " " ") - TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_test " " " ") - TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) + target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_test PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -77,7 +77,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) #INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5debug h5repart h5mkgrp RUNTIME DESTINATION diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index cc9c5e2..d55e9de 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES family_file00000.h5 family_file00001.h5 family_file00002.h5 @@ -29,18 +29,18 @@ family_file00017.h5 ) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repart POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (HDF5_MKGRP_TEST_FILES + set (HDF5_MKGRP_TEST_FILES #h5mkgrp_help.txt #h5mkgrp_version h5mkgrp_single.ls @@ -60,18 +60,18 @@ # make test dir FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") - #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") + #message (STATUS " Copying ${h5_mkgrp_file}") + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} ) - ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -86,7 +86,7 @@ ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -96,18 +96,18 @@ ${resultfile}.out.err ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN} ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) ADD_TEST ( NAME H5MKGRP-${resultfile}-h5ls @@ -122,13 +122,13 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -150,7 +150,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -171,10 +171,10 @@ scd_family00003.h5 family_to_sec2.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPART-clearall-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) @@ -192,11 +192,11 @@ ADD_TEST (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) - SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP-clearall-objects COMMAND ${CMAKE_COMMAND} @@ -243,11 +243,11 @@ h5mkgrp_nested_mult_lp.out.err ) SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5MKGRP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5MKGRP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") |