| 1 | # processed with configure_file @ONLY so may need @VAR@ rather than ${VAR} in some circumstances |
|---|
| 2 | # $Id$ |
|---|
| 3 | # |
|---|
| 4 | #==================================================================== |
|---|
| 5 | # NeXus - A common data format for neutron, x-ray and muon science. |
|---|
| 6 | # |
|---|
| 7 | # CPackOptions.cmake.in for building the NeXus library and applications. |
|---|
| 8 | # |
|---|
| 9 | # Copyright (C) 2008-2012 NeXus International Advisory Committee (NIAC) |
|---|
| 10 | # |
|---|
| 11 | # This library is free software; you can redistribute it and/or |
|---|
| 12 | # modify it under the terms of the GNU Lesser General Public |
|---|
| 13 | # License as published by the Free Software Foundation; either |
|---|
| 14 | # version 2 of the License, or (at your option) any later version. |
|---|
| 15 | # |
|---|
| 16 | # This library is distributed in the hope that it will be useful, |
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 19 | # Lesser General Public License for more details. |
|---|
| 20 | # |
|---|
| 21 | # You should have received a copy of the GNU Lesser General Public |
|---|
| 22 | # License along with this library; if not, write to the Free |
|---|
| 23 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|---|
| 24 | # MA 02111-1307 USA |
|---|
| 25 | # |
|---|
| 26 | # For further information, see <http://www.nexusformat.org> |
|---|
| 27 | # |
|---|
| 28 | # |
|---|
| 29 | #==================================================================== |
|---|
| 30 | # |
|---|
| 31 | |
|---|
| 32 | include(CPackComponent) |
|---|
| 33 | |
|---|
| 34 | #set(CPACK_ALL_INSTALL_TYPES Full) |
|---|
| 35 | #set(CPACK_COMPONENTS_ALL manual definitions) # default is all components mentioned |
|---|
| 36 | |
|---|
| 37 | if (NOT WIN32) |
|---|
| 38 | if (${CMAKE_VERSION} VERSION_LESS 2.8.4) |
|---|
| 39 | set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove this line when CMake >= 2.8.4 is required |
|---|
| 40 | endif() |
|---|
| 41 | endif() |
|---|
| 42 | |
|---|
| 43 | set (CPACK_PACKAGE_NAME "NeXusDefinitions") |
|---|
| 44 | |
|---|
| 45 | if (${CPACK_GENERATOR} STREQUAL "DEB") |
|---|
| 46 | set(CPACK_DEB_COMPONENT_INSTALL ON) |
|---|
| 47 | set(CPACK_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 48 | set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 49 | set(CPACK_PACKAGE_NAME "nexus") # used for components |
|---|
| 50 | # set(CPACK_DEBIAN_PACKAGE_DEBUG TRUE) |
|---|
| 51 | set (CPACK_DEBIAN_PACKAGE_NAME "nexus") |
|---|
| 52 | set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all") |
|---|
| 53 | set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) |
|---|
| 54 | set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.nexusformat.org/") |
|---|
| 55 | endif() |
|---|
| 56 | if (${CPACK_GENERATOR} STREQUAL "RPM") |
|---|
| 57 | # set(CPACK_RPM_USER_BINARY_SPECFILE "@CMAKE_BINARY_DIR@/nexus_definitions.spec") |
|---|
| 58 | set(CPACK_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 59 | set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 60 | # set(CPACK_RPM_PACKAGE_PREFIX "/usr/share/nexus") |
|---|
| 61 | # set(CPACK_RPM_PACKAGE_DEBUG TRUE) |
|---|
| 62 | set (CPACK_RPM_PACKAGE_NAME "nexus") |
|---|
| 63 | set (CPACK_RPM_PACKAGE_ARCHITECTURE "noarch") |
|---|
| 64 | set (CPACK_RPM_PACKAGE_RELEASE "1") |
|---|
| 65 | # set (CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8") |
|---|
| 66 | # set (CPACK_RPM_PACKAGE_PROVIDES "") |
|---|
| 67 | set(CPACK_RPM_COMPONENT_INSTALL ON) |
|---|
| 68 | set(CPACK_RPM_PACKAGE_LICENSE "LGPL") |
|---|
| 69 | set(CPACK_RPM_PACKAGE_URL "http://www.nexusformat.org/") |
|---|
| 70 | # set(CPACK_RPM_CHANGELOG_FILE "") |
|---|
| 71 | endif() |
|---|
| 72 | if (${CPACK_GENERATOR} STREQUAL "TGZ") |
|---|
| 73 | set(CPACK_TGZ_COMPONENT_INSTALL ON) |
|---|
| 74 | set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) |
|---|
| 75 | set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON) |
|---|
| 76 | set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) |
|---|
| 77 | endif() |
|---|
| 78 | if (${CPACK_GENERATOR} STREQUAL "ZIP") |
|---|
| 79 | set(CPACK_ZIP_COMPONENT_INSTALL ON) |
|---|
| 80 | set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) |
|---|
| 81 | set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON) |
|---|
| 82 | set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) |
|---|
| 83 | endif() |
|---|
| 84 | if (${CPACK_GENERATOR} STREQUAL "CygwinBinary") |
|---|
| 85 | set(CPACK_CYGWIN_PATCH_NUMBER 1) |
|---|
| 86 | set(CPACK_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 87 | set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 88 | endif() |
|---|
| 89 | if (${CPACK_GENERATOR} STREQUAL "PackageMaker") |
|---|
| 90 | # set(CPACK_MONOLITHIC_INSTALL ON) |
|---|
| 91 | # 10.4 is "Tiger", component based install needs 10.4 and above |
|---|
| 92 | set(CPACK_OSX_PACKAGE_VERSION 10.4) |
|---|
| 93 | set(CPACK_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 94 | set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus") |
|---|
| 95 | endif() |
|---|
| 96 | if (${CPACK_GENERATOR} STREQUAL "Bundle") |
|---|
| 97 | endif() |
|---|
| 98 | |
|---|
| 99 | set(CPACK_PACKAGE_CONTACT "NeXus Developers <nexus-tech@nexusformat.org>") |
|---|
| 100 | |
|---|
| 101 | set (CPACK_PACKAGE_VENDOR "NeXus International Advisory Committee (nexus-tech@nexusformat.org)") |
|---|
| 102 | set (CPACK_PACKAGE_VERSION_MAJOR "3") |
|---|
| 103 | set (CPACK_PACKAGE_VERSION_MINOR "1") |
|---|
| 104 | set (CPACK_PACKAGE_VERSION_PATCH "0") |
|---|
| 105 | set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") |
|---|
| 106 | set (CPACK_RESOURCE_FILE_LICENSE "@CMAKE_SOURCE_DIR@/LGPL.txt") |
|---|
| 107 | set (CPACK_RESOURCE_FILE_README "@CMAKE_SOURCE_DIR@/package/README.txt") |
|---|
| 108 | set (CPACK_RESOURCE_FILE_WELCOME "@CMAKE_SOURCE_DIR@/package/WELCOME.txt") |
|---|
| 109 | set (CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR@/package/nexus.ico") |
|---|
| 110 | set (CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_SOURCE_DIR@/package/description.txt") |
|---|
| 111 | set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeXus NXDL class definitions and manual, http://www.nexusformat.org/") |
|---|
| 112 | set (CPACK_PACKAGE_FILE_NAME "nexus-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") |
|---|
| 113 | set (CPACK_SOURCE_PACKAGE_FILE_NAME "nexus-source-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") |
|---|
| 114 | set (CPACK_PACKAGE_INSTALL_DIRECTORY "NeXus Definitions") |
|---|
| 115 | |
|---|
| 116 | #set(CPACK_SOURCE_IGNORE_FILES |
|---|
| 117 | # "nexus_spec.in;~$;/\.svn/;/\.cvsignore/;/CMakeFiles/;/nbproject/;autogen.sh;cmake_install.cmake;Makefile;${CPACK_SOURCE_IGNORE_FILES}") |
|---|
| 118 | |
|---|
| 119 | # we do not have any absolute paths, so do not need DESTDIR |
|---|
| 120 | SET(CPACK_SET_DESTDIR "OFF") |
|---|
| 121 | SET(CPACK_PACKAGE_RELOCATABLE "true") |
|---|
| 122 | |
|---|
| 123 | if (${CPACK_GENERATOR} STREQUAL "NSIS") |
|---|
| 124 | ### NSIS component installs seem to trigger download option at the moment, so set monolithic install and a full package name until we can figure out why |
|---|
| 125 | set(CPACK_MONOLITHIC_INSTALL ON) |
|---|
| 126 | set(CPACK_PACKAGE_FILE_NAME "nexus-definitions-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") |
|---|
| 127 | set(CPACK_NSIS_PACKAGE_NAME "NeXus Definitions ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") |
|---|
| 128 | set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeXus") |
|---|
| 129 | set(CPACK_NSIS_HELP_LINK "http://www.nexusformat.org/") |
|---|
| 130 | set(CPACK_NSIS_URL_INFO_ABOUT "http://www.nexusformat.org/") |
|---|
| 131 | set(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}") |
|---|
| 132 | set(CPACK_NSIS_MODIFY_PATH OFF) |
|---|
| 133 | # set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "!include \"@CMAKE_SOURCE_DIR@/nsis_install.nsh\"") |
|---|
| 134 | # set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "!include \"@CMAKE_SOURCE_DIR@/nsis_uninstall.nsh\"") |
|---|
| 135 | set(CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico") |
|---|
| 136 | set(CPACK_NSIS_MUI_ICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico") |
|---|
| 137 | set(CPACK_NSIS_MUI_UNIICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico") |
|---|
| 138 | set(CPACK_NSIS_MENU_LINKS "manual/NeXusManual.html" "NeXus Manual (HTML)" |
|---|
| 139 | "manual/NeXusManual.pdf" "NeXus User Manual (PDF)" |
|---|
| 140 | "manual/NeXusRefDoc.pdf" "NeXus Reference Manual (PDF)" |
|---|
| 141 | "definitions" "NeXus Definitions (NXDL)" |
|---|
| 142 | "http://www.nexusformat.org/" "NeXus Web Site") |
|---|
| 143 | endif() |
|---|
| 144 | |
|---|
| 145 | cpack_add_component(definitions |
|---|
| 146 | DISPLAY_NAME "NeXus NXDL definitions" |
|---|
| 147 | DESCRIPTION "Binary applications such as nxconvert, nxbrowse etc..." |
|---|
| 148 | # INSTALL_TYPES Full |
|---|
| 149 | # GROUP definitions_group |
|---|
| 150 | ) |
|---|
| 151 | |
|---|
| 152 | cpack_add_component(manual |
|---|
| 153 | DISPLAY_NAME "NeXus Documentation" |
|---|
| 154 | DESCRIPTION "NeXus User Guide and Reference Documentation with examples." |
|---|
| 155 | # INSTALL_TYPES Full |
|---|
| 156 | # GROUP manual_group |
|---|
| 157 | ) |
|---|
| 158 | |
|---|
| 159 | #cpack_add_install_type(Full DISPLAY_NAME "Full") |
|---|
| 160 | |
|---|
| 161 | #cpack_add_component_group(definitions_group |
|---|
| 162 | # DISPLAY_NAME definitions |
|---|
| 163 | # DESCRIPTION definitions |
|---|
| 164 | # EXPANDED |
|---|
| 165 | # BOLD_TITLE) |
|---|
| 166 | |
|---|
| 167 | #cpack_add_component_group(manual_group |
|---|
| 168 | # DISPLAY_NAME manual |
|---|
| 169 | # DESCRIPTION manual |
|---|
| 170 | # EXPANDED |
|---|
| 171 | # BOLD_TITLE) |
|---|
| 172 | |
|---|
| 173 | #cpack_add_component(Development |
|---|
| 174 | # DISPLAY_NAME "Development" |
|---|
| 175 | # DESCRIPTION "Development libraries and headers." |
|---|
| 176 | # ) |
|---|
| 177 | |
|---|
| 178 | #cpack_add_component(Examples |
|---|
| 179 | # DISPLAY_NAME "Examples" |
|---|
| 180 | # DESCRIPTION "Code example files." |
|---|
| 181 | # ) |
|---|