forked from stephanecharette/DarkHelp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CM_package.cmake
69 lines (61 loc) · 2.97 KB
/
CM_package.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
# DarkHelp - C++ helper class for Darknet's C API.
# Copyright 2019-2021 Stephane Charette <[email protected]>
# MIT license applies. See "license.txt" for details.
SET ( CPACK_PACKAGE_VENDOR "Stephane Charette" )
SET ( CPACK_PACKAGE_CONTACT "[email protected]" )
SET ( CPACK_PACKAGE_VERSION ${DH_VERSION} )
SET ( CPACK_PACKAGE_VERSION_MAJOR ${DH_VER_MAJOR} )
SET ( CPACK_PACKAGE_VERSION_MINOR ${DH_VER_MINOR} )
SET ( CPACK_PACKAGE_VERSION_PATCH ${DH_VER_PATCH} )
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "DarkHelp" )
SET ( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt )
SET ( CPACK_PACKAGE_NAME "darkhelp" )
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "DarkHelp C++ library" )
SET ( CPACK_PACKAGE_DESCRIPTION "DarkHelp C++ library" )
SET ( CPACK_PACKAGE_HOMEPAGE_URL "https://www.ccoderun.ca/DarkHelp/" )
IF ( WIN32 )
SET ( CPACK_PACKAGE_FILE_NAME "darkhelp-${DH_VERSION}-Windows-64" )
SET ( CPACK_NSIS_PACKAGE_NAME "DarkHelp" )
SET ( CPACK_NSIS_DISPLAY_NAME "DarkHelp v${DH_VERSION}" )
SET ( CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\src-tool\\\\DarkHelp.ico" )
SET ( CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\src-tool\\\\DarkHelp.ico" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\src-tool\\\\DarkHelp.ico" )
SET ( CPACK_NSIS_CONTACT "[email protected]" )
SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.ccoderun.ca/DarkHelp/" )
SET ( CPACK_NSIS_HELP_LINK "https://www.ccoderun.ca/DarkHelp/" )
SET ( CPACK_NSIS_MODIFY_PATH "ON" )
SET ( CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON" )
SET ( CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\DarkHelp.ico" )
SET ( CPACK_GENERATOR "NSIS" )
ELSE ()
# Get the kernel name. This should give us a string such as "Linux".
EXECUTE_PROCESS (
COMMAND uname -s
OUTPUT_VARIABLE DH_UNAME_S
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the machine hardware name. This should give us a string such as "x86_64" or "aarch64" (Jetson Nano for example).
EXECUTE_PROCESS (
COMMAND uname -m
OUTPUT_VARIABLE DH_UNAME_M
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the name "Ubuntu".
EXECUTE_PROCESS (
COMMAND lsb_release --id
COMMAND cut -d\t -f2
OUTPUT_VARIABLE DH_LSB_ID
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the version number "20.04".
EXECUTE_PROCESS (
COMMAND lsb_release --release
COMMAND cut -d\t -f2
OUTPUT_VARIABLE DH_LSB_REL
OUTPUT_STRIP_TRAILING_WHITESPACE )
SET ( CPACK_PACKAGE_FILE_NAME "darkhelp-${DH_VERSION}-${DH_UNAME_S}-${DH_UNAME_M}-${DH_LSB_ID}-${DH_LSB_REL}" )
SET ( CPACK_DEBIAN_PACKAGE_SECTION "other" )
SET ( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Stephane Charette <[email protected]>" )
SET ( CPACK_GENERATOR "DEB" )
SET ( CPACK_SOURCE_IGNORE_FILES ".svn" ".kdev4" "build/" "build_and_upload" )
SET ( CPACK_SOURCE_GENERATOR "TGZ;ZIP" )
ENDIF ()
INCLUDE( CPack )