The packaging of a release is managed by CMake/CPack.
In the main CMakeLists.txt file, we include packing instructions only if we are in release mode :
if(CMAKE_BUILD_TYPE STREQUAL "Release")
include(Packing)
endif()
This will include the file Packing.cmake in the cmake directory.
This file defines variables that CPack will use to generate the two configuration files :
- CPackConfig.cmake : for binary packages
- CPackSourceConfig.cmake : for source package
To define what package to generate based on the platform, there is a section in Packing.cmake :
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CPACK_GENERATOR ZIP)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CPACK_GENERATOR DragNDrop)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_GENERATOR DEB)
else ()
set(CPACK_GENERATOR TGZ)
endif ()
For the source, we include everything that is in the root directory. This is managed by CPack.
We only remove the build directory, .git files and the game/version.h file which is generated at configuration time.
The format for packaging the source code is ZIP as it is managed on all platforms.