# opencl-c-headers contains the host-side OpenCL headers
set(PACKAGE_DEPENDENCIES "opencl-c-headers")
if(BUILD_ICD)
	# If we build with ICD support, we need the library (from ocl-icd-opencl-dev and its dependencies)
	set(PACKAGE_DEPENDENCIES "${PACKAGE_DEPENDENCIES}, ocl-icd-opencl-dev")
endif()
if(INCLUDE_COMPILER)
	# If we build with VC4C enabled, we need the VC4C package
	set(PACKAGE_DEPENDENCIES "${PACKAGE_DEPENDENCIES}, vc4c")
endif()

set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_PACKAGE_NAME "vc4cl")
string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}-${BUILD_TIMESTAMP}")
if (CROSS_COMPILE)
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
else()
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
endif()
set(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_DEPENDENCIES})
if(BUILD_ICD)
	# provides the opencl-icd meta-package representing an OpenCL implementation which can be accessed via the ICD loader
	set(CPACK_DEBIAN_PACKAGE_PROVIDES "opencl-icd")
endif()
set(CPACK_PACKAGE_VENDOR "doe300")
set(CPACK_PACKAGE_CONTACT "doe300@web.de")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCL Runtime for Videocore 4 (raspberrypi only)")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/doe300/VC4CL")
set(CPACK_PACKAGE_FILE_NAME "vc4cl-0.4-Linux")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
include(CPack)
