summaryrefslogtreecommitdiff
path: root/installer/CMakeLists.txt
blob: ef8aba824650e8f6d9dea48c0a5ba83e23fc7efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_CONTACT "${PROJECT_MAINTAINER}")
set(CPACK_PACKAGE_VERSION ${ejdb_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${ejdb_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${ejdb_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${ejdb_VERSION_PATCH})
set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION_SUMMARY})
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README")
set(CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_BUILD_TYPE}-${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
    set(CPACK_STRIP_FILES ON)
endif()

if (PACKAGE_DEB)
	execute_process (
	  COMMAND          /usr/bin/dpkg --print-architecture
	  OUTPUT_VARIABLE  CPACK_DEBIAN_PACKAGE_ARCHITECTURE
	  RESULT_VARIABLE  EXECUTE_RESULT
	  OUTPUT_STRIP_TRAILING_WHITESPACE
	  ERROR_QUIET
	)
	if (EXECUTE_RESULT)
	  message(FATAL_ERROR "dpkg not found: No package generation.")
	endif()
	set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
	set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROJECT_WEBSITE})
	set(CPACK_DEBIAN_PACKAGE_SECTION libs)
	set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
	set(CPACK_DEBIAN_PACKAGE_DEPENDS zlib1g)
	set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS pkg-config git devscripts dh-make zlib1g-dev)
	set(PPA_DEBIAN_VERSION ppa3)
	if (PROJECT_PPA)
		set(DPUT_HOST ${PROJECT_PPA})
	endif()
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "any")
	set(CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG ${CMAKE_SOURCE_DIR}/Changelog)
	set(CPACK_DEBIAN_UPDATE_CHANGELOG ON)
endif(PACKAGE_DEB)

include(CPack)

if (ENABLE_PPA)
    include(UploadPPA)
endif()