OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
doc
/
cmake
/
html
/
_sources
/
guide
/
tutorial
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
04/04/2023 07:10:48 PM
rwxr-xr-x
📄
A Basic Starting Point.rst.txt
12.93 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding Export Configuration.rst.txt
5.99 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding Generator Expressions.rst.txt
9.32 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding Support for a Testing Dashboard.rst.txt
3.15 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding System Introspection.rst.txt
4.71 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding Usage Requirements for a Library.rst.txt
4.46 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding a Custom Command and Generated File.rst.txt
3.62 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Adding a Library.rst.txt
12.31 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Installing and Testing.rst.txt
8.94 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Packaging Debug and Release.rst.txt
3.01 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Packaging an Installer.rst.txt
2.53 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
Selecting Static or Shared Libraries.rst.txt
3.12 KB
04/04/2023 07:03:28 PM
rw-r--r--
📄
index.rst.txt
1.13 KB
04/04/2023 07:03:28 PM
rw-r--r--
Editing: Packaging an Installer.rst.txt
Close
Step 9: Packaging an Installer ============================== Next suppose that we want to distribute our project to other people so that they can use it. We want to provide both binary and source distributions on a variety of platforms. This is a little different from the install we did previously in :guide:`tutorial/Installing and Testing`, where we were installing the binaries that we had built from the source code. In this example we will be building installation packages that support binary installations and package management features. To accomplish this we will use CPack to create platform specific installers. Specifically we need to add a few lines to the bottom of our top-level ``CMakeLists.txt`` file. .. literalinclude:: Step10/CMakeLists.txt :caption: CMakeLists.txt :name: CMakeLists.txt-include-CPack :language: cmake :start-after: # setup installer That is all there is to it. We start by including :module:`InstallRequiredSystemLibraries`. This module will include any runtime libraries that are needed by the project for the current platform. Next we set some CPack variables to where we have stored the license and version information for this project. The version information was set earlier in this tutorial and the ``License.txt`` has been included in the top-level source directory for this step. The :variable:`CPACK_SOURCE_GENERATOR` variable selects a file format for the source package. Finally we include the :module:`CPack module <CPack>` which will use these variables and some other properties of the current system to setup an installer. The next step is to build the project in the usual manner and then run the :manual:`cpack <cpack(1)>` executable. To build a binary distribution, from the binary directory run: .. code-block:: console cpack To specify the generator, use the :option:`-G <cpack -G>` option. For multi-config builds, use :option:`-C <cpack -C>` to specify the configuration. For example: .. code-block:: console cpack -G ZIP -C Debug For a list of available generators, see :manual:`cpack-generators(7)` or call :option:`cpack --help`. An :cpack_gen:`archive generator <CPack Archive Generator>` like ZIP creates a compressed archive of all *installed* files. To create an archive of the *full* source tree you would type: .. code-block:: console cpack --config CPackSourceConfig.cmake Alternatively, run ``make package`` or right click the ``Package`` target and ``Build Project`` from an IDE. Run the installer found in the binary directory. Then run the installed executable and verify that it works.