## Packaging.
set (CPACK_SYSTEM_NAME                  "${CMAKE_SYSTEM_NAME}")
set (CPACK_PACKAGE_NAME                 "${MAIN_NAME}")
set (CPACK_PACKAGE_VENDOR               "${MAIN_AUTHOR}")
set (CPACK_PACKAGE_CONTACT              "${MAIN_EMAIL}")
set (CPACK_PACKAGE_VERSION_MAJOR        "${VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR        "${VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH        "${VERSION_PATCH}")
set (CPACK_PACKAGE_VERSION              "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set (CPACK_PACKAGE_DESCRIPTION_FILE     "${CMAKE_SOURCE_DIR}/INFORMATION")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY  "${MAIN_BRIEF}")
set (CPACK_PACKAGE_FILE_NAME            "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
set (CPACK_RESOURCE_FILE_README         "${CMAKE_SOURCE_DIR}/README.md")
set (CPACK_RESOURCE_FILE_LICENSE        "${CMAKE_SOURCE_DIR}/LICENSE")

## Debian packaging.
set (CPACK_DEBIAN_PACKAGE_NAME          "${CPACK_PACKAGE_NAME}")
set (CPACK_DEBIAN_PACKAGE_VERSION       "${CPACK_PACKAGE_VERSION}")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER    "${MAIN_AUTHOR} <${MAIN_EMAIL}>")
set (CPACK_DEBIAN_PACKAGE_SECTION       "devel")
set (CPACK_DEBIAN_PACKAGE_PRIORITY      "optional")
set (CPACK_DEBIAN_PACKAGE_DEPENDS       "")
set (CPACK_DEBIAN_PACKAGE_RECOMMENDS    "")
set (CPACK_DEBIAN_PACKAGE_SUGGESTS      "")
set (CPACK_DEBIAN_PACKAGE_CONFLICTS     "")

include (CPack)

## Enable output of compile commands during generation.
## For the YouCompleteMe
## Check the ${CMAKE_BINARY_DIR}/compile_commands.json file.
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)

## Print result messages.
tbag_preview ()

