-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
134 lines (121 loc) · 5.56 KB
/
CMakeLists.txt
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# Build file of USBK CryptoBridge
#
# Tamara Electronics (C) 2010
#
# GNU General Public License
#
# Project name
PROJECT (usbk)
# CMAKE Settings
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
SET(${PROJECT_NAME}_VERSION_MAJOR 1)
SET(${PROJECT_NAME}_VERSION_MINOR 2)
SET(${PROJECT_NAME}_VERSION_PATCH 10)
SET(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
SET(${PROJECT_NAME}_VERSION_FULL "${${PROJECT_NAME}_VERSION}.${${PROJECT_NAME}_VERSION_PATCH}")
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
INCLUDE (Uninstaller)
ADD_SUBDIRECTORY( libusbk )
ADD_SUBDIRECTORY( usbk_cli )
ADD_SUBDIRECTORY( man )
UNINSTALLLER_FEATURE()
SET(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB;RPM")
# Settings for standard package
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VENDOR "Tamara Elektronik <[email protected]>")
SET(CPACK_PACKAGE_VERSION "${${PROJECT_NAME}_VERSION_FULL}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "USBK CryptoBridge CLI")
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${${PROJECT_NAME}_VERSION_FULL}_${CMAKE_SYSTEM_PROCESSOR}")
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "TMR_USBK")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/NEWS")
IF (UNIX)
ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
SET( DISTCLEANED
CMakeFiles
cmake.depends
cmake.check_depends
CMakeCache.txt
*/CMakeCache.txt
cmake.check_cache
*.cmake
Makefile
core core.*
gmon.out
*~
*/Makefile
*/CMakeFiles
*/cmake_install.cmake
libusbk/*.so*
usbk_cli/usbk
man/*.gz
)
ADD_CUSTOM_COMMAND(
DEPENDS clean
COMMENT "distribution clean"
COMMAND rm
ARGS -Rf CMakeTmp ${DISTCLEANED}
TARGET distclean
)
ENDIF(UNIX)
# Settings for debian package
#SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME ${PROJECT_NAME})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tamara Elektronik <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION " USBK CryptoBridge Linux CLI Program\n USBK Linux CLI program allows user to manage USBK(s) plugged to the host system. The USBK is a device which protects user's critical data on USB Flash Disk and USB External Hard Drive by AES (Advanced Encryption Standard). The two models of USBK are available as A101 and A103. A101 has one encryption key and A103 has also 3 encryption keys.")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${${PROJECT_NAME}_VERSION_FULL}")
IF(CMAKE_CROSSCOMPILING)
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "alpha")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
# Subdir is "arm" for both big-endian (arm) and little-endian (armel).
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
# mips* machines are bi-endian mostly so processor does not tell
# endianess of the underlying system.
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "ppc64")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "ppc")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "parisc" "parisc64")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
# s390 binaries can run on s390x machines
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "sh")
ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ENDIF(CMAKE_CROSSCOMPILING)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "udev (>= 151-12.3)")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "recommends")
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "suggests")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_IGNORE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/.git #Git
${CMAKE_CURRENT_SOURCE_DIR}/.settings #Eclipse
${CMAKE_CURRENT_SOURCE_DIR}/.cproject #Eclipse
${CMAKE_CURRENT_SOURCE_DIR}/.project #Eclipse
${CMAKE_CURRENT_BINARY_DIR} #Build #TODO: If CMAKE_CURRENT_BINARY_DIR == CMAKE_CURRENT_BINARY_DIR, source zip file is empty.
)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
INCLUDE(CPack)