diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-11-23 21:05:39 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-11-23 21:05:39 (GMT) |
commit | 5ab92a43a30edfce9a250043d3514f591aaf9fca (patch) | |
tree | effadaec8fd9165b180ebe8220946e2d4f6643b7 /CMakeLists.txt | |
parent | 27fdd5c09cbcf32cb78816ceca4f9aabe8037cae (diff) | |
download | hdf5-5ab92a43a30edfce9a250043d3514f591aaf9fca.zip hdf5-5ab92a43a30edfce9a250043d3514f591aaf9fca.tar.gz hdf5-5ab92a43a30edfce9a250043d3514f591aaf9fca.tar.bz2 |
[svn-r19837] Correct external library packing for install/cpack
Tested: Windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 131 |
1 files changed, 69 insertions, 62 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 63ceb7c..60f48a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -616,41 +616,68 @@ ENDIF (HDF5_ENABLE_SZIP_SUPPORT) #----------------------------------------------------------------------------- # Option for external libraries on windows #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) - IF (BUILD_SHARED_LIBS) - FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) +OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) +IF (HDF5_PACKAGE_EXTLIBS) + SET (EXTERNAL_LIBRARY_LIST "") + SET (EXTERNAL_LIBRARYDLL_LIST "") + IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + 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") + ADD_DEPENDENCIES (ZLIB-Library-Copy ZLIB) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) - # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") - GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) - # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") - ADD_CUSTOM_TARGET (ZLIB-Release-Copy ALL - 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") - ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + 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") + ADD_DEPENDENCIES (SZIP-Library-Copy SZIP) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + IF (WIN32 AND NOT CYGWIN) + IF (BUILD_SHARED_LIBS) + IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) + # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") + GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) + # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") + ADD_CUSTOM_TARGET (ZLIB-Release-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}/" + ) + SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) - # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") - GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) - # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") - ADD_CUSTOM_TARGET (SZIP-Release-Copy ALL - 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") - ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) + # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") + GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) + # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") + ADD_CUSTOM_TARGET (SZIP-Release-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}/" + ) + SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ENDIF (BUILD_SHARED_LIBS) -ENDIF (WIN32 AND NOT CYGWIN) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (WIN32 AND NOT CYGWIN) +ENDIF (HDF5_PACKAGE_EXTLIBS) #----------------------------------------------------------------------------- # Option to use threadsafe @@ -829,22 +856,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) - INSTALL( - FILES ${ZLIB_LIBRARY} - DESTINATION ${HDF5_INSTALL_LIB_DIR} - COMPONENT libraries - ) - IF (WIN32 AND BUILD_SHARED_LIBS) - GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) - # message(STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") - GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) - # message(STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") - INSTALL( - FILES ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${HDF5_INSTALL_BIN_DIR} - COMPONENT libraries - ) - ENDIF (WIN32 AND BUILD_SHARED_LIBS) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) INSTALL ( @@ -852,23 +863,19 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + INSTALL( + FILES ${EXTERNAL_LIBRARY_LIST} + DESTINATION ${HDF5_INSTALL_LIB_DIR} + COMPONENT libraries + ) + IF (WIN32 AND BUILD_SHARED_LIBS) INSTALL( - FILES ${SZIP_LIBRARY} - DESTINATION ${HDF5_INSTALL_LIB_DIR} + FILES ${EXTERNAL_LIBRARYDLL_LIST} + DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) - IF (WIN32 AND BUILD_SHARED_LIBS) - GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) - # message(STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") - GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) - # message(STATUS "SZIP_BIN_PATH: ${ZLIB_BIN_PATH}") - INSTALL( - FILES ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${HDF5_INSTALL_BIN_DIR} - COMPONENT libraries - ) - ENDIF (WIN32 AND BUILD_SHARED_LIBS) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + ENDIF (WIN32 AND BUILD_SHARED_LIBS) ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) |