Add the changelog file to debian packages.

This commit is contained in:
Username404 2021-03-24 15:50:29 +01:00
parent 5e08f52668
commit 91570df79a
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 15 additions and 0 deletions

View File

@ -91,6 +91,21 @@ if (UNIX AND NOT MINGW)
set(CPACK_RPM_PACKAGE_AUTOREQ YES)
set(CPACK_RPM_PACKAGE_LICENSE "MPL-2.0")
set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/changelog")
if (NOT APPLE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz"
COMMAND gzip -c -k -9 "${CMAKE_CURRENT_SOURCE_DIR}/changelog" > ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/changelog"
COMMENT "Compressing the changelog file"
)
add_custom_target(changelog ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz")
string(TOLOWER "${CMAKE_INSTALL_DOCDIR}" DEB_CHANGELOG_DEST_DIR) # Lowercase characters are needed because GNUInstallDirs uses the PROJECT_NAME variable.
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz"
DESTINATION ${DEB_CHANGELOG_DEST_DIR}
)
endif()
set(CPACK_RPM_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_RPM_PACKAGE_RELEASE ${TIME})
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)