-
Notifications
You must be signed in to change notification settings - Fork 10
/
CPackLists.txt
87 lines (67 loc) · 3.11 KB
/
CPackLists.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
# INSTALL( TARGETS FileIO
# ARCHIVE
# LIBRARY DESTINATION lib/FileIO
# COMPONENT libraries)
# INSTALL( FILES ${HEADER_FILES}
# DESTINATION include
# COMPONENT headers)
SET(MAJOR_VERSION 1)
IF (NOT DEFINED ${VERSION})
MESSAGE("Extracting git software version")
execute_process(COMMAND bash "-c" "git rev-list --branches HEAD | wc -l | tr -d ' ' | tr -d '\n'" OUTPUT_VARIABLE GIT_VERSION)
SET(MINOR_VERSION ${GIT_VERSION})
SET(BUILD_NUMBER 0)
SET(VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER})
ENDIF()
MESSAGE("Software Version: ${VERSION}")
IF (NOT DEFINED ${CPACK_INSTALL_PREFIX})
SET(CPACK_INSTALL_PREFIX "/usr/local")
ENDIF()
SET(CPACK_PACKAGE_NAME FileIO)
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
SET(CPACK_PACKAGE_VERSION_PATCH ${BUILD_NUMBER})
SET(CPACK_PACKAGE_DESCRIPTION "FileIO deals with file access and directory traversal.
The FileIO utilities are written to be fast, easy to use and utilizing return values rather than exceptions for error handling.
MIT License. Copyright (c) 2014 LogRhythm.
Repository: https://github.com/LogRhythm/FileIO")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION})
SET(CPACK_PACKAGE_CONTACT "LogRhythm kjell.hedstrom@logrhythm.com")
SET(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SRC}/../LICENSE)
SET(CPACK_PACKAGE_VENDOR "LogRhythm")
SET(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SRC}/../LICENSE)
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output dir for libraries")
SET(CMAKE_INSTALL_HEADERDIR include CACHE PATH "Output dir for headers")
INSTALL( TARGETS FileIO
ARCHIVE DESTINATION ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
COMPONENT libraries)
INSTALL( FILES ${HEADER_FILES}
DESTINATION ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_HEADERDIR}
COMPONENT headers)
SET(CPACK_COMPONENTS_ALL libraries headers)
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "FileIO libraries")
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "FileIO C++ headers")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "LogRhythm")
MESSAGE("\nTo create installation package: ")
MESSAGE("make package")
ENDIF()
MESSAGE("\nOption to install using 'sudo make install")
MESSAGE("Installation locations: ")
MESSAGE("====================")
MESSAGE("Headers: ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_HEADERDIR}")
MESSAGE("Library : ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
MESSAGE("For more information please see FileIO/CPackLists.txt")
MESSAGE("To install: sudo dpkg -i FileIO-<version>-Linux.deb")
MESSAGE("To list files in install package: sudo dpkg --contents FileIO-<version>-Linux.deb")
MESSAGE("To list installed files: sudo dpkg -L FileIO")
MESSAGE("To remove: sudo dpkg -r FileIO")
MESSAGE("To remove: sudo dpkg -r FileIO")
# NOTE: to change installation locations you can use the settings below
# examples:
# CPACK_INSTALL_PREFIX
# CMAKE_INSTALL_HEADERDIR
# CMAKE_INSTALL_LIBDIR
INCLUDE(CPack)