diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2011-03-31 20:39:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2011-03-31 20:39:18 (GMT) |
commit | f4e7559bd2d8bbd59535cbcafab78e162a6bffb6 (patch) | |
tree | b4339300a7d08fe64266ad183213da8a38fb986e /CMakeLists.txt | |
parent | 9c0a2b214519c6f0508964981be19bf2e3054e35 (diff) | |
download | hdf5-f4e7559bd2d8bbd59535cbcafab78e162a6bffb6.zip hdf5-f4e7559bd2d8bbd59535cbcafab78e162a6bffb6.tar.gz hdf5-f4e7559bd2d8bbd59535cbcafab78e162a6bffb6.tar.bz2 |
[svn-r20383] Description:
Bring r19714:20382 from trunk to revise_chunks branch
Tested:
Linux 2.6/64 (chicago)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 172 |
1 files changed, 15 insertions, 157 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 304d86d..0dfe687 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- +INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- @@ -229,7 +230,7 @@ INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) # Option to use legacy naming for windows libs/programs, default is legacy #----------------------------------------------------------------------------- IF (WIN32 AND NOT CYGWIN) - OPTION (H5_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" ON) + OPTION (HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF) ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- @@ -299,6 +300,7 @@ IF (WIN32) IF (NOT CYGWIN) ADD_DEFINITIONS (-DBIND_TO_CURRENT_VCLIBS_VERSION=1) ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) + ADD_DEFINITIONS (-D_CONSOLE) ENDIF (NOT CYGWIN) ENDIF (WIN32) @@ -457,13 +459,16 @@ OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) 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 (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + 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 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") + SET (ZLIB_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) + SET (SZIP_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- @@ -483,58 +488,7 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) ELSE (ZLIB_FOUND) 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 - -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 - -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) - IF (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${CMAKE_IMPORT_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ENDIF (WIN32 AND NOT MINGW) - ELSE (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (BUILD_SHARED_LIBS) - SET (ZLIB_INCLUDE_DIR_GEN - "${BINARY_DIR}" - ) - SET (ZLIB_INCLUDE_DIR - "${SOURCE_DIR}/src" - ) - - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + 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) @@ -571,55 +525,7 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) ELSE (SZIP_FOUND) 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 - -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 - -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) - - - IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${CMAKE_IMPORT_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ENDIF (WIN32 AND NOT MINGW) - ELSE (BUILD_SHARED_LIBS) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - ENDIF (BUILD_SHARED_LIBS) - 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}) + 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) @@ -647,39 +553,11 @@ IF (HDF5_PACKAGE_EXTLIBS) FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - ADD_CUSTOM_TARGET (ZLIB-GenHeader-Copy ALL - 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) - ADD_CUSTOM_TARGET (ZLIB-Library-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${ZLIB_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - 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" 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" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ADD_CUSTOM_TARGET (SZIP-GenHeader-Copy ALL - 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) - ADD_CUSTOM_TARGET (SZIP-Library-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - 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" 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" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (HDF5_PACKAGE_EXTLIBS) @@ -698,16 +576,6 @@ IF (WIN32 AND NOT CYGWIN) 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" 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" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB) - 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) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) @@ -722,16 +590,6 @@ IF (WIN32 AND NOT CYGWIN) 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" 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" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP) - 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) ENDIF (BUILD_SHARED_LIBS) @@ -1061,7 +919,7 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (NOT HDF5_EXTERNALLY_CONFIGURED) SET (CPACK_PACKAGE_VENDOR "The HDF Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}") + SET (CPACK_PACKAGE_INSTALL_DIRECTORY "HDFGroup/${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") |