1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
# Xiphos build script
#
# Copyright (C) 2018 Xiphos Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# packaging xiphos
# setting up common variables to all packagers
message(STATUS "Configuring binary and source packagers")
# The name of the package (or application). If not specified, defaults to
# the project name.
set (CPACK_PACKAGE_NAME "${PROJECT_NAME}")
# The name of the package vendor.
set(CPACK_PACKAGE_VENDOR "The Xiphos Development Team")
set(CPACK_PACKAGE_CONTACT "xiphos-devel@crosswire.org")
# The directory in which CPack is doing its packaging. If it is not set then
# this will default (internally) to the build dir.
# set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/packages)
# Package major Version
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
# Package minor Version
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
# Package patch Version
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# Package full version, used internally. By default, this is built from
# CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR,
# and CPACK_PACKAGE_VERSION_PATCH.
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
# A text file used to describe the project. Used, for example, the introduction
# screen of a CPack-generated Windows installer to describe the project.
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/xiphos.desc)
# Short description of the project (only a few words).
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"An environment for Bible reading, study, and research")
# The name of the package file to generate, not including the extension.
# The default value is:
# ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}
#set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
# Installation directory on the target system. This may be used by some CPack
# generators like NSIS to create an installation directory below the
# installation prefix. All installed element will be put inside this directory.
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CMAKE_BINARY_DIR})
# A branding image that will be displayed by GUI installers.
set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/cpack/windows/pixmaps/header.bmp)
# CPack-time project CPack configuration file. This file included at cpack time,
# once per generator after CPack has set CPACK_GENERATOR to the actual generator
# being used. It allows per-generator setting of CPACK* variables at cpack time.
#set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/XiphosCPackConfig.cmake)
# License to be embedded in the installer. It will typically be displayed to the
# user by the produced installer. This license file is not installed.
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/COPYING)
# README file to be embedded in the installer. It typically describes the
# purpose of the project during the installation. Not all CPack generators uses
# this file.
#set(CPACK_RESOURCE_FILE_README "")
# Welcome file to be embedded in the installer. It welcomes users to this
# installer. Typically used in the graphical installers on Windows and Mac OS X.
#set(CPACK_RESOURCE_FILE_WELCOME "")
# Disables the component-based installation mechanism. When set the component
# specification is ignored and all installed items are put in a single
# “MONOLITHIC” package. Some CPack generators do monolithic packaging by default
# and may be asked to do component packaging by setting
# CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
set(CPACK_MONOLITHIC_INSTALL "OFF")
# List of CPack generators to use. If not specified, CPack will create a set of
# options CPACK_BINARY_<GENNAME> (e.g., CPACK_BINARY_NSIS) allowing the user to
# enable/disable individual generators.
set(CPACK_GENERATOR "DEB;RPM")
# The name of the CPack binary configuration file. This file is the CPack
# configuration generated by the CPack module for binary installers.
# Defaults to CPackConfig.cmake.
#set(CPACK_OUTPUT_CONFIG_FILE CPackConfig.cmake)
# Lists each of the executables and associated text label to be used to create
# Start Menu shortcuts. For example, setting this to the list ccmake;CMake will
# create a shortcut named “CMake” that will execute the installed executable
# ccmake. Not all CPack generators use it (at least NSIS, WIX and OSXX11 do).
set(CPACK_PACKAGE_EXECUTABLES "Xiphos;xiphos")
# A boolean variable which enables stripping of all files.
set(CPACK_STRIP_FILES ON)
# If set to TRUE, values of variables prefixed with CPACK will be escaped before
# being written to the configuration files, so that the cpack program receives
# them exactly as they were specified. If not, characters like quotes and
# backslashes can cause parsing errors or alter the value received by the cpack
# program. Defaults to FALSE for backwards compatibility.
set(CPACK_VERBATIM_VARIABLES ON)
# The following CPack variables are specific to source packages, and will not
# affect binary packages:
# The name of the source package.
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
# A boolean variable which enables stripping of all source files
set(CPACK_SOURCE_STRIP_FILES ON)
# List of generators used for the source packages. As with CPACK_GENERATOR, if
# this is not specified then CPack will create a set of options allowing users
# to select which packages will be generated.
set(CPACK_SOURCE_GENERATOR "ZIP;TGZ")
# The name of the CPack source configuration file. This file is the CPack
# configuration generated by the CPack module for source installers. Defaults
# to CPackSourceConfig.cmake.
#set(CPACK_SOURCE_OUTPUT_CONFIG_FILE CPackSourceConfig.cmake)
# Pattern of files in the source tree that won’t be packaged when building
# a source package
set (CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}/"
"/.bzrignore"
"/.bzrrules"
"/.git/"
"/.gitignore"
"/.github"
"/.bzrignore/"
"/.bzrrules/"
"/.clang-format"
"/.ci-build.yml"
"/xiphos-${CPACK_PACKAGE_VERSION}-win32.exe"
"/xiphos-${CPACK_PACKAGE_VERSION}-win64.exe"
)
# The following variables are for advanced uses of CPack:
# What CMake generator should be used if the project is CMake project.
# Defaults to the value of CMAKE_GENERATOR
#set(CPACK_CMAKE_GENERATOR ${CMAKE_GENERATOR})
# List of four values that specify what project to install. The four values are:
# Build directory, Project Name, Project Component, Directory.
# If omitted, CPack will build an installer that installs everything.
#set(CPACK_INSTALL_CMAKE_PROJECTS "")
# System name, defaults to the value of ${CMAKE_SYSTEM_NAME}.
#set(CPACK_SYSTEM_NAME$ {CMAKE_SYSTEM_NAME})
# Directory for the installed files.
#set(CPACK_TOPLEVEL_TAG "")
# Extra commands to install components.
#set(CPACK_INSTALL_COMMANDS "")
# Extra directories to install.
#set(CPACK_INSTALLED_DIRECTORIES "")
# Registry key used when installing this project. This is only used by installer
# for Windows. The default value is based on the installation directory.
#set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "")
# List of desktop links to create. Each desktop link requires a corresponding
# start menu shortcut as created by CPACK_PACKAGE_EXECUTABLES.
#set(CPACK_CREATE_DESKTOP_LINKS "")
# Try to find architecture
if(UNIX)
execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
string(STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
endif(UNIX)
# call generators
if (UNIX)
# CPack RPM generator
include(fedora/XiphosRPMPkg.cmake)
# CPack Debian generator (Unix only)
include(debian/XiphosDebianPkg.cmake)
endif (UNIX)
if(WIN32)
set(CPACK_GENERATOR "NSIS")
# CPack NSIS generator on Windows using the Nullsoft Installation System
include(windows/XiphosWindowsPkg.cmake)
endif(WIN32)
# run CPack
include(CPack)
|