forked from neo4j-drivers/seabolt
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeCPack.cmake
72 lines (60 loc) · 2.67 KB
/
CMakeCPack.cmake
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "neo4j")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "seabolt: The C Connector Library for Neo4j")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/neo4j-drivers/seabolt")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_MONOLITHIC_INSTALL ON)
if (WIN32 OR MINGW)
unset(CPACK_PACKAGING_INSTALL_PREFIX)
else ()
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
endif ()
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_CHECKSUM "SHA256")
set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/.git/;.gitignore;menu.yml")
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/dist-package")
if (UNIX)
set(CPACK_GENERATOR "TGZ")
else ()
set(CPACK_GENERATOR "ZIP")
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${OS_ID}-${OS_VERSION_ID}")
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(CMAKE_BITNESS "64")
elseif (CMAKE_SIZEOF_VOID_P STREQUAL "4")
set(CMAKE_BITNESS "32")
endif ()
if (MSVC)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win${CMAKE_BITNESS}-msvc")
else ()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win${CMAKE_BITNESS}-mingw")
endif ()
endif ()
if (UNIX)
if (OS_ID_LIKE MATCHES "debian")
list(APPEND CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_NAME "${SEABOLT_NAME}")
set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "neo4j")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/package/deb/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/package/deb/postrm;")
endif ()
if (OS_ID_LIKE MATCHES "rhel|fedora|suse")
list(APPEND CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_NAME "${SEABOLT_NAME}")
set(CPACK_RPM_PACKAGE_RELEASE "1")
set(CPACK_RPM_PACKAGE_LICENSE "Apache")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/package/rpm/post")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/package/rpm/postun")
endif ()
endif ()
message(STATUS "CPack generators: ${CPACK_GENERATOR}")
include(CPack)