diff options
Diffstat (limited to 'CMakeInstallation.cmake')
-rw-r--r-- | CMakeInstallation.cmake | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 1e6a5bf..f2053b5 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -1,5 +1,13 @@ #----------------------------------------------------------------------------- +# Check for Installation Utilities +#----------------------------------------------------------------------------- +if (WIN32) + find_program (NSIS_EXECUTABLE NSIS.exe PATHS "$ENV{ProgramFiles}\\NSIS" "$ENV{ProgramFiles(x86)}\\NSIS") + find_program (WIX_EXECUTABLE candle PATHS "$ENV{ProgramFiles}\\WiX\ Toolset\ v3.9\\bin" "$ENV{ProgramFiles(x86)}\\WiX\ Toolset\ v3.9\\bin") +endif (WIN32) + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- if (NOT HDF5_INSTALL_NO_DEVELOPMENT) @@ -142,6 +150,13 @@ endif (HDF5_PACK_EXAMPLES) HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- +# Configure the COPYING.txt file for the windows binary package +#----------------------------------------------------------------------------- +if (WIN32) + configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) +endif (WIN32) + +#----------------------------------------------------------------------------- # Add Document File(s) to CMake Install #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -197,6 +212,19 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") endif (NOT HDF5_EXTERNALLY_CONFIGURED) +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + else (CMAKE_HOST_UNIX) + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + endif (CMAKE_HOST_UNIX) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- @@ -222,7 +250,11 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_GENERATOR "TGZ") if (WIN32) - list (APPEND CPACK_GENERATOR "NSIS") + set (CPACK_GENERATOR "ZIP") + + if (NSIS_EXECUTABLE) + list (APPEND CPACK_GENERATOR "NSIS") + endif (NSIS_EXECUTABLE) # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) @@ -246,6 +278,47 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_MONOLITHIC_INSTALL ON) set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) + + if (WIX_EXECUTABLE) + list (APPEND CPACK_GENERATOR "WIX") + endif (WIX_EXECUTABLE) +#WiX variables + set (CPACK_WIX_UNINSTALL "1") +# .. variable:: CPACK_WIX_LICENSE_RTF +# RTF License File +# +# If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is. +# +# If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly +# converted to RTF by the WiX Generator. +# The expected encoding of the .txt file is UTF-8. +# +# With CPACK_WIX_LICENSE_RTF you can override the license file used by the +# WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported +# format or the .txt -> .rtf conversion does not work as expected. + set (CPACK_RESOURCE_FILE_LICENSE "${HDF5_BINARY_DIR}/COPYING.txt") +# .. variable:: CPACK_WIX_PRODUCT_ICON +# The Icon shown next to the program name in Add/Remove programs. + set(CPACK_WIX_PRODUCT_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico") +# +# .. variable:: CPACK_WIX_UI_BANNER +# +# The bitmap will appear at the top of all installer pages other than the +# welcome and completion dialogs. +# +# If set, this image will replace the default banner image. +# +# This image must be 493 by 58 pixels. +# +# .. variable:: CPACK_WIX_UI_DIALOG +# +# Background bitmap used on the welcome and completion dialogs. +# +# If this variable is set, the installer will replace the default dialog +# image. +# +# This image must be 493 by 312 pixels. +# elseif (APPLE) list (APPEND CPACK_GENERATOR "DragNDrop") set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) |