# Used for building a Debian package
SET(CPACK_PACKAGE_VERSION ${L2DBUS_MAJOR_VERSION}.${L2DBUS_MINOR_VERSION}.${L2DBUS_RELEASE_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR "${L2DBUS_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${L2DBUS_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${L2DBUS_RELEASE_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${V_MAJOR}.${V_MINOR}")
SET(CPACK_PACKAGE_CONTACT "Glenn Schmottlach")
SET(CPACK_PACKAGE_VENDOR "XS-Embedded LLC")
SET(CPACK_RESOURCE_FILE_LICENSE "${L2DBUS_ROOT_DIR}/LICENSE")
SET(CPACK_RESOURCE_FILE_README "${L2DBUS_ROOT_DIR}/README.md")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME
  "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

IF( CMAKE_BUILD_TYPE STREQUAL "Release" )
    SET(CPACK_STRIP_FILES TRUE)
ELSE( CMAKE_BUILD_TYPE STREQUAL "Release" )
    SET(CPACK_STRIP_FILES FALSE)
ENDIF( CMAKE_BUILD_TYPE STREQUAL "Release" )

 # This must always be last statement!
INCLUDE(CPack)