[svn-r20853] Add CPack commands to properly include extlibs into package

Tested: windows
This commit is contained in:
Allen Byrne 2011-05-17 17:12:36 -05:00
parent 05ee8cdd18
commit 29411fc602

View File

@ -721,84 +721,6 @@ IF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
)
ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
#-----------------------------------------------------------------------------
# Option for external libraries
#-----------------------------------------------------------------------------
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
IF (HDF5_PACKAGE_EXTLIBS)
IF (WIN32 AND BUILD_SHARED_LIBS)
SET (HDF5_INSTALL_EXTLIB_DIR ${HDF5_INSTALL_BIN_DIR})
ELSE (WIN32 AND BUILD_SHARED_LIBS)
SET (HDF5_INSTALL_EXTLIB_DIR ${HDF5_INSTALL_LIB_DIR})
ENDIF (WIN32 AND BUILD_SHARED_LIBS)
IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND)
INSTALL (
FILES ${ZLIB_INCLUDE_DIR}/zlib.h
DESTINATION ${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT headers
)
GET_PROPERTY (ZLIB_LIB TARGET ${ZLIB_LIBRARY} PROPERTY LOCATION_${BLDTYPE})
INSTALL(
FILES ${ZLIB_LIB}
DESTINATION ${HDF5_INSTALL_EXTLIB_DIR}
COMPONENT libraries
)
IF (BUILD_SHARED_LIBS)
IF (WIN32)
GET_PROPERTY (ZLIB_IMPLIB TARGET ${ZLIB_LIBRARY} PROPERTY IMPORTLIBRARY_${BLDTYPE})
INSTALL(
FILES ${ZLIB_IMPLIB}
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
ELSE (WIN32)
GET_PROPERTY (ZLIB_SOVERSION TARGET ${ZLIB_LIBRARY} PROPERTY SOVERSION)
INSTALL(
FILES ${ZLIB_LIB}.${ZLIB_SOVERSION}
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
ENDIF (WIN32)
ENDIF (BUILD_SHARED_LIBS)
ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND)
IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
INSTALL (
FILES ${SZIP_INCLUDE_DIR}/szlib.h ${SZIP_INCLUDE_DIR}/szip_adpt.h ${SZIP_INCLUDE_DIR}/ricehdf.h
DESTINATION ${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT headers
)
GET_PROPERTY (SZIP_LIB TARGET ${SZIP_LIBRARY} PROPERTY LOCATION_${BLDTYPE})
INSTALL(
FILES ${SZIP_LIB}
DESTINATION ${HDF5_INSTALL_EXTLIB_DIR}
COMPONENT libraries
)
IF (BUILD_SHARED_LIBS)
IF (WIN32)
GET_PROPERTY (SZIP_IMPLIB TARGET ${SZIP_LIBRARY} PROPERTY IMPORTLIBRARY_${BLDTYPE})
INSTALL(
FILES ${SZIP_IMPLIB}
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
ELSE (WIN32)
GET_PROPERTY (SZIP_SOVERSION TARGET ${SZIP_LIBRARY} PROPERTY SOVERSION)
INSTALL(
FILES ${SZIP_LIB}.${SZIP_SOVERSION}
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
ENDIF (WIN32)
ENDIF (BUILD_SHARED_LIBS)
ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
INSTALL (
FILES ${EXTERNAL_HEADER_LIST}
DESTINATION ${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT headers
)
ENDIF (HDF5_PACKAGE_EXTLIBS)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
@ -935,9 +857,24 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED)
ELSE (WIN32)
SET (CPACK_RPM_COMPONENT_INSTALL ON)
ENDIF (WIN32)
SET (CPACK_MONOLITHIC_INSTALL ON)
INCLUDE(InstallRequiredSystemLibraries)
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;ALL;/")
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;ALL;/")
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(InstallRequiredSystemLibraries)
#---------------------------------------------------------------------------
# Now list the cpack commands