include(InstallRequiredSystemLibraries)
 
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_DESCRIPTION "A small demo C++ executable")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "long description bla bla bla... bah")
set(CPACK_PACKAGE_VENDOR "DroidDrive")
set(CPACK_PACKAGE_CONTACT "daixtrose@users.noreply.github.com")
set(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-src")

SET(CPACK_SOURCE_IGNORE_FILES  "\\\\.#;/#;.*~")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.bz2")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.gz")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "/build/")    
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "/bin/")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "/lib/")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "Makefile")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "Makefile\\\\..*")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeFiles")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "cmake_install.cmake")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "install_manifest.txt")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "CPackConfig.cmake")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "CPackSourceConfig.cmake")

set(CPACK_GENERATOR "DEB" "TGZ")

# - CPack configuration for individual targets 
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CMakeCPackConfig.cmake)
# - CPack configuration for all targets 

include(CPack)