diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-01-25 21:19:46 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-01-25 21:19:46 (GMT) |
commit | cad19fff1ae726ac191134d45e0f9b1b692bbadc (patch) | |
tree | a7969f27dbe116ce21c3ec4169862ef282490183 /CMakeLists.txt | |
parent | f134f15fcf371651c862b2ad7dbcc0ddfd5a0ed4 (diff) | |
download | hdf5-cad19fff1ae726ac191134d45e0f9b1b692bbadc.zip hdf5-cad19fff1ae726ac191134d45e0f9b1b692bbadc.tar.gz hdf5-cad19fff1ae726ac191134d45e0f9b1b692bbadc.tar.bz2 |
[svn-r19994] Added ability to use compressed file for external libraries
Bring 19993 from trunk
Tested: local linux
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 119 |
1 files changed, 74 insertions, 45 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a1eb395..60af09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,16 +440,17 @@ INCLUDE (ExternalProject) OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO") OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0) OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") SET (ZLIB_USE_EXTERNAL 1) SET (SZIP_USE_EXTERNAL 1) - IF (NOT ZLIB_SVN_URL) - SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk") - ENDIF (NOT ZLIB_SVN_URL) - IF (NOT SZIP_SVN_URL) - SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk") - ENDIF (NOT SZIP_SVN_URL) -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + IF (NOT TGZ_PATH}) + SET (TGZ_PATH ${HDF5_SOURCE_DIR}) + ENDIF (NOT TGZ_PATH}) + SET (ZLIB_TGZ_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) + SET (SZIP_TGZ_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support @@ -467,15 +468,28 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (H5_ZLIB_HEADER "zlib.h") SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) ELSE (ZLIB_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_SVN_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBLDTYPE:STRING=Release - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - ) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + EXTERNALPROJECT_ADD (ZLIB + SVN_REPOSITORY ${ZLIB_SVN_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBLDTYPE:STRING=Release + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + ) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + EXTERNALPROJECT_ADD (ZLIB + #LOG_DOWNLOAD 1 + URL ${ZLIB_TGZ_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBLDTYPE:STRING=Release + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + ) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) IF (BUILD_SHARED_LIBS) @@ -513,9 +527,9 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (H5_HAVE_ZLIB_H 1) SET (H5_HAVE_LIBZ 1) MESSAGE (STATUS "Filter ZLIB is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + 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 @@ -544,16 +558,30 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) SET (H5_HAVE_LIBSZ 1) SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) ELSE (SZIP_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_SVN_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBLDTYPE:STRING=Release - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} - ) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + EXTERNALPROJECT_ADD (SZIP + SVN_REPOSITORY ${SZIP_SVN_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBLDTYPE:STRING=Release + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} + ) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + EXTERNALPROJECT_ADD (SZIP + #LOG_DOWNLOAD 1 + URL ${SZIP_TGZ_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBLDTYPE:STRING=Release + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} + ) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) @@ -586,9 +614,9 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) SET (H5_HAVE_SZLIB_H 1) SET (H5_HAVE_LIBSZ 1) MESSAGE (STATUS "Filter SZIP is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + 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") + 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_DIRS}) @@ -620,10 +648,10 @@ IF (HDF5_PACKAGE_EXTLIBS) ) GET_FILENAME_COMPONENT(ZLIB_LIB_NAME ${ZLIB_LIBRARY} NAME) SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) ADD_DEPENDENCIES (ZLIB-Library-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) @@ -638,10 +666,10 @@ IF (HDF5_PACKAGE_EXTLIBS) ) GET_FILENAME_COMPONENT(SZIP_LIB_NAME ${SZIP_LIBRARY} NAME) SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) ADD_DEPENDENCIES (SZIP-Library-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (HDF5_PACKAGE_EXTLIBS) @@ -657,18 +685,18 @@ IF (WIN32 AND NOT CYGWIN) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") IF (HDF5_PACKAGE_EXTLIBS) SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) ADD_CUSTOM_TARGET (ZLIB-Dll-Copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) @@ -681,18 +709,18 @@ IF (WIN32 AND NOT CYGWIN) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") IF (HDF5_PACKAGE_EXTLIBS) SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) ADD_CUSTOM_TARGET (SZIP-Dll-Copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) @@ -729,14 +757,14 @@ ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +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) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Build utility to copy and strip X lines of file @@ -1043,6 +1071,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ENDIF (WIN32) INCLUDE (CPack) + INCLUDE(InstallRequiredSystemLibraries) #--------------------------------------------------------------------------- # Now list the cpack commands |