Statistics
| Branch: | Tag: | Revision:

root / host / Modules / UHDPackage.cmake @ 2249acd9

History | View | Annotate | Download (4.77 KB)

1
#
2
# Copyright 2010-2011 Ettus Research LLC
3
#
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
#
17

    
18
########################################################################
19
INCLUDE(UHDVersion) #sets version information
20

    
21
########################################################################
22
# Setup package file name
23
########################################################################
24
IF(UHD_PACKAGE_MODE STREQUAL AUTO)
25
    FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release)
26
    FIND_PROGRAM(UNAME_EXECUTABLE uname)
27
    IF(LSB_RELEASE_EXECUTABLE AND UNAME_EXECUTABLE)
28

    
29
        #extract system information by executing the commands
30
        EXECUTE_PROCESS(
31
            COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id
32
            OUTPUT_VARIABLE _os_name OUTPUT_STRIP_TRAILING_WHITESPACE
33
        )
34
        EXECUTE_PROCESS(
35
            COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release
36
            OUTPUT_VARIABLE _os_version OUTPUT_STRIP_TRAILING_WHITESPACE
37
        )
38
        EXECUTE_PROCESS(
39
            COMMAND ${UNAME_EXECUTABLE} --machine
40
            OUTPUT_VARIABLE _machine OUTPUT_STRIP_TRAILING_WHITESPACE
41
        )
42

    
43
        #set generator type for recognized systems
44
        IF(${_os_name} STREQUAL Ubuntu)
45
            SET(CPACK_GENERATOR DEB)
46
        ENDIF()
47
        IF(${_os_name} STREQUAL Fedora)
48
            SET(CPACK_GENERATOR RPM)
49
        ENDIF()
50

    
51
        #set a more sensible package name for this system
52
        SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${_os_name}-${_os_version}-${_machine}")
53

    
54
    ENDIF(LSB_RELEASE_EXECUTABLE AND UNAME_EXECUTABLE)
55

    
56
    IF(APPLE)
57
        SET(CPACK_GENERATOR PackageMaker)
58
    ELSEIF(WIN32)
59
        SET(CPACK_GENERATOR NSIS)
60
    ENDIF()
61

    
62
ENDIF(UHD_PACKAGE_MODE STREQUAL AUTO)
63

    
64
########################################################################
65
# Setup CPack General
66
########################################################################
67
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ettus Research - Universal Hardware Driver")
68
SET(CPACK_PACKAGE_VENDOR              "Ettus Research LLC")
69
SET(CPACK_PACKAGE_CONTACT             "support@ettus.com")
70
SET(CPACK_PACKAGE_VERSION_MAJOR ${UHD_VERSION_MAJOR})
71
SET(CPACK_PACKAGE_VERSION_MINOR ${UHD_VERSION_MINOR})
72
SET(CPACK_PACKAGE_VERSION_PATCH ${UHD_VERSION_PATCH})
73
SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.txt)
74
SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/AUTHORS.txt)
75
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
76

    
77
########################################################################
78
# Setup CPack Components
79
########################################################################
80
SET(CPACK_COMPONENT_LIBRARIES_GROUP      "Development")
81
SET(CPACK_COMPONENT_HEADERS_GROUP        "Development")
82
SET(CPACK_COMPONENT_UTILITIES_GROUP      "Runtime")
83
SET(CPACK_COMPONENT_EXAMPLES_GROUP       "Runtime")
84
SET(CPACK_COMPONENT_TESTS_GROUP          "Runtime")
85
SET(CPACK_COMPONENT_MANUAL_GROUP         "Documentation")
86
SET(CPACK_COMPONENT_DOXYGEN_GROUP        "Documentation")
87

    
88
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME      "Libraries")
89
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME        "C++ Headers")
90
SET(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME      "Utilities")
91
SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME       "Examples")
92
SET(CPACK_COMPONENT_TESTS_DISPLAY_NAME          "Unit Tests")
93
SET(CPACK_COMPONENT_MANUAL_DISPLAY_NAME         "Manual")
94
SET(CPACK_COMPONENT_DOXYGEN_DISPLAY_NAME        "Doxygen")
95

    
96
SET(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
97
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
98
SET(CPACK_COMPONENT_TESTS_DEPENDS libraries)
99

    
100
SET(CPACK_COMPONENTS_ALL libraries headers utilities examples tests manual doxygen)
101

    
102
########################################################################
103
# Setup CPack Debian
104
########################################################################
105
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0, libboost-dev")
106
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python, python-tk")
107

    
108
########################################################################
109
# Setup CPack RPM
110
########################################################################
111
SET(CPACK_RPM_PACKAGE_REQUIRES "boost-devel, libusb1")
112

    
113
########################################################################
114
INCLUDE(CPack) #include after setting vars