if(NOT CPACK_OUTPUT_FILE_PREFIX)
    set(CPACK_OUTPUT_FILE_PREFIX packages)
endif()

set(CPACK_PACKAGE_CHECKSUM SHA256)
set(CPACK_PACKAGE_CONTACT "sycl@codeplay.com")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
# set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/logo.png")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_VENDOR "Codeplay Software")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSES.TXT")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
# set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/WELCOME.md")


file(STRINGS .gitignore CPACK_SOURCE_IGNORE_FILES REGEX "[ \\t\\r]*[^#]+")
list(APPEND CPACK_SOURCE_IGNORE_FILES .gitignore .git)

if("${CPACK_GENERATOR}" MATCHES "(DEB|RPM)")
    set(CPACK_COMPONENTS_GROUPING IGNORE)
endif()

cpack_add_install_type(User DISPLAY_NAME "End user")
cpack_add_install_type(Developer DISPLAY_NAME "Developer")

include(CPack)
