forked from dbry/lzw-ab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CPackConfig.cmake
55 lines (47 loc) · 1.99 KB
/
CPackConfig.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
set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
set (CPACK_PACKAGE_VERSION ${LZWS_VERSION})
set (CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set (CPACK_PACKAGE_LICENSE "BSD")
set (CPACK_RPM_PACKAGE_LICENSE ${CPACK_PACKAGE_LICENSE})
set (CPACK_FREEBSD_PACKAGE_LICENSE ${CPACK_PACKAGE_LICENSE})
set (CPACK_PACKAGE_MAINTAINER "Andrew Aladjev <aladjev.andrew@gmail.com>")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_MAINTAINER})
set (CPACK_FREEBSD_PACKAGE_MAINTAINER ${CPACK_PACKAGE_MAINTAINER})
set (CPACK_FREEBSD_PACKAGE_ORIGIN "archivers/${PROJECT_NAME}")
if (DEFINED CMAKE_SYSTEM_PROCESSOR AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "")
string (TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CPACK_PACKAGE_ARCHITECTURE)
else ()
set (CPACK_PACKAGE_ARCHITECTURE "x86_64")
endif ()
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE})
set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE})
if (LZWS_BIGNUM_LIBRARY STREQUAL "gmp")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgmp-dev")
set (CPACK_RPM_PACKAGE_REQUIRES "gmp-devel")
set (CPACK_FREEBSD_PACKAGE_DEPS "math/gmp")
elseif (LZWS_BIGNUM_LIBRARY STREQUAL "tommath")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libtommath-dev")
set (CPACK_RPM_PACKAGE_REQUIRES "libtommath-devel")
set (CPACK_FREEBSD_PACKAGE_DEPS "math/libtommath")
else ()
message (FATAL_ERROR "Invalid bignum library: ${LZWS_BIGNUM_LIBRARY}")
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set (CPACK_GENERATOR "DEB" "RPM")
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set (CPACK_GENERATOR "DragNDrop")
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set (CPACK_GENERATOR "FREEBSD")
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
set (CPACK_GENERATOR "NSIS")
endif ()
set (
PACKAGE_NAME
"${CPACK_PACKAGE_NAME}-${LZWS_COMPRESSOR_DICTIONARY}-${LZWS_BIGNUM_LIBRARY}"
)
set (
CPACK_PACKAGE_FILE_NAME
"${PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_ARCHITECTURE}"
)
set (CPACK_STRIP_FILES true)