1# ------------------- Debianization --------------------- 2if (UNIX) 3 4 # Set build environment 5 SET(CPACK_GENERATOR "TGZ;DEB") 6 SET(CPACK_SOURCE_TGZ "ON") 7 8 # Common package information 9 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY 10 "FlatBuffers is an efficient cross platform serialization library for C++, with support for Java, C# and Go. It was created at Google specifically for game development and other performance-critical applications.") 11 SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers") 12 SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Vitaly Isaev <vitalyisaev2@gmail.com>") 13 14 SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) 15 SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) 16 SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) 17 SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}") 18 SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") 19 20 # Derive architecture 21 IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) 22 FIND_PROGRAM(DPKG_CMD dpkg) 23 IF(NOT DPKG_CMD) 24 MESSAGE(STATUS "Can not find dpkg in your path, default to i386.") 25 SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) 26 ENDIF(NOT DPKG_CMD) 27 EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture 28 OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE 29 OUTPUT_STRIP_TRAILING_WHITESPACE 30 ) 31 ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) 32 33 # Package name 34 SET(CPACK_DEBIAN_PACKAGE_NAME "flatbuffers") 35 SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt) 36 SET(CPACK_PACKAGE_FILE_NAME 37 "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") 38 39endif(UNIX) 40