• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
2set(CPACK_PACKAGE_CONTACT "${PROJECT_MAINTAINER}")
3set(CPACK_PACKAGE_VERSION ${ejdb2_VERSION})
4set(CPACK_PACKAGE_VERSION_MAJOR ${ejdb2_VERSION_MAJOR})
5set(CPACK_PACKAGE_VERSION_MINOR ${ejdb2_VERSION_MINOR})
6set(CPACK_PACKAGE_VERSION_PATCH ${ejdb2_VERSION_PATCH})
7set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
8set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION_SUMMARY})
9set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
10set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
11set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
12set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README.md")
13set(CPACK_PACKAGE_FILE_NAME
14  "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_BUILD_TYPE}-${CMAKE_SYSTEM_NAME}-${PROJECT_ARCH}")
15if (CMAKE_BUILD_TYPE STREQUAL "Release")
16  set(CPACK_STRIP_FILES ON)
17endif ()
18
19set(DEB_CMAKE_ARGS "-DBUILD_SHARED_LIBS=ON")
20
21if (PACKAGE_DEB)
22  execute_process(
23    COMMAND /usr/bin/dpkg --print-architecture
24    OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
25    RESULT_VARIABLE EXECUTE_RESULT
26    OUTPUT_STRIP_TRAILING_WHITESPACE
27    ERROR_QUIET
28  )
29  if (EXECUTE_RESULT)
30    message(FATAL_ERROR "dpkg not found: No package generation.")
31  endif ()
32  set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
33  set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROJECT_WEBSITE})
34  set(CPACK_DEBIAN_PACKAGE_SECTION libs)
35  set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
36  #set(CPACK_DEBIAN_PACKAGE_DEPENDS libcurl4)
37  set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS pkg-config git devscripts dh-make libcurl4-openssl-dev)
38  if (NOT PPA_DEBIAN_VERSION)
39    set(PPA_DEBIAN_VERSION ppa1)
40  endif ()
41  if (PROJECT_PPA)
42    set(DPUT_HOST ${PROJECT_PPA})
43  endif ()
44  set(CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG ${CMAKE_SOURCE_DIR}/Changelog)
45  set(CPACK_DEBIAN_UPDATE_CHANGELOG ON)
46endif (PACKAGE_DEB)
47
48if (PACKAGE_TGZ)
49  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
50endif (PACKAGE_TGZ)
51
52include(CPack)
53
54if (ENABLE_PPA)
55  if (NOT PROJECT_PPA_DISTRIB_TARGET)
56    set(PROJECT_PPA_DISTRIB_TARGET focal)
57  endif ()
58  set(DPUT_CONFIG_IN ${CMAKE_CURRENT_SOURCE_DIR}/../debian/dput.cf.in)
59  include(UploadPPA)
60endif ()
61