diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-01-25 20:40:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-01-25 20:40:41 (GMT) |
commit | e2ff4638f5c26d4368fcb02da91974de4c3f0f82 (patch) | |
tree | 70b5c85a0ff74c3b060aa32f94a7d16d008b5530 /CMakeLists.txt | |
parent | 8d6c8b941116e3295355ff9fc801a61738977787 (diff) | |
download | hdf5-e2ff4638f5c26d4368fcb02da91974de4c3f0f82.zip hdf5-e2ff4638f5c26d4368fcb02da91974de4c3f0f82.tar.gz hdf5-e2ff4638f5c26d4368fcb02da91974de4c3f0f82.tar.bz2 |
[svn-r19991] Added ability to use compressed file for external libraries
Tested: local linux
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 118 |
1 files changed, 68 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b3023d1..3b0b696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,11 +132,6 @@ 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) -# set default prefix location -#IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) -# SET(CMAKE_INSTALL_PREFIX "hdf5" CACHE PATH "Install path prefix, prepended onto install directories" FORCE) -#ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - IF (NOT HDF5_INSTALL_BIN_DIR) SET (HDF5_INSTALL_BIN_DIR bin) ENDIF (NOT HDF5_INSTALL_BIN_DIR) @@ -443,16 +438,10 @@ 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") +ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support @@ -470,15 +459,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) @@ -516,9 +518,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 @@ -547,16 +549,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) @@ -589,9 +605,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}) @@ -623,10 +639,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) @@ -641,10 +657,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) @@ -660,18 +676,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) @@ -684,18 +700,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) @@ -732,14 +748,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 @@ -1038,6 +1054,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) SET (CPACK_PACKAGE_RELOCATABLE TRUE) IF (WIN32) + SET (CPACK_NSIS_CONTACT "help@hdfgroup.org") SET (CPACK_NSIS_MODIFY_PATH ON) SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") ELSE (WIN32) @@ -1045,6 +1062,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ENDIF (WIN32) INCLUDE (CPack) + INCLUDE(InstallRequiredSystemLibraries) #--------------------------------------------------------------------------- # Now list the cpack commands |