Statistics
| Branch: | Tag: | Revision:

root / host / Modules / UHDPackage.cmake @ 834bcbad

History | View | Annotate | Download (4.8 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 additional defines for OS types
23
########################################################################
24
IF(UNIX AND EXISTS "/etc/debian_version")
25
    SET(DEBIAN TRUE)
26
ENDIF()
27

    
28
IF(UNIX AND EXISTS "/etc/redhat-release")
29
    SET(REDHAT TRUE)
30
ENDIF()
31

    
32
########################################################################
33
# Setup package file name
34
########################################################################
35
IF(UHD_RELEASE_MODE)
36

    
37
    #set generator type for recognized systems
38
    IF(APPLE)
39
        SET(CPACK_GENERATOR PackageMaker)
40
    ELSEIF(WIN32)
41
        SET(CPACK_GENERATOR NSIS)
42
    ELSEIF(DEBIAN)
43
        SET(CPACK_GENERATOR DEB)
44
    ELSEIF(REDHAT)
45
        SET(CPACK_GENERATOR RPM)
46
    ELSE()
47
        SET(CPACK_GENERATOR TGZ)
48
    ENDIF()
49

    
50
    FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release)
51
    IF(LSB_RELEASE_EXECUTABLE)
52

    
53
        #extract system information by executing the commands
54
        EXECUTE_PROCESS(
55
            COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id
56
            OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE
57
        )
58
        EXECUTE_PROCESS(
59
            COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release
60
            OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE
61
        )
62

    
63
        #set a more sensible package name for this system
64
        SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}")
65

    
66
    ENDIF(LSB_RELEASE_EXECUTABLE)
67

    
68
ENDIF(UHD_RELEASE_MODE)
69

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

    
83
########################################################################
84
# Setup CPack Components
85
########################################################################
86
SET(CPACK_COMPONENT_LIBRARIES_GROUP      "Development")
87
SET(CPACK_COMPONENT_HEADERS_GROUP        "Development")
88
SET(CPACK_COMPONENT_UTILITIES_GROUP      "Runtime")
89
SET(CPACK_COMPONENT_EXAMPLES_GROUP       "Runtime")
90
SET(CPACK_COMPONENT_TESTS_GROUP          "Runtime")
91
SET(CPACK_COMPONENT_MANUAL_GROUP         "Documentation")
92
SET(CPACK_COMPONENT_DOXYGEN_GROUP        "Documentation")
93

    
94
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME      "Libraries")
95
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME        "C++ Headers")
96
SET(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME      "Utilities")
97
SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME       "Examples")
98
SET(CPACK_COMPONENT_TESTS_DISPLAY_NAME          "Unit Tests")
99
SET(CPACK_COMPONENT_MANUAL_DISPLAY_NAME         "Manual")
100
SET(CPACK_COMPONENT_DOXYGEN_DISPLAY_NAME        "Doxygen")
101

    
102
SET(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
103
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
104
SET(CPACK_COMPONENT_TESTS_DEPENDS libraries)
105

    
106
SET(CPACK_COMPONENTS_ALL libraries headers utilities examples tests manual doxygen)
107

    
108
########################################################################
109
# Setup CPack Debian
110
########################################################################
111
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0, libboost-dev")
112
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python, python-tk")
113

    
114
########################################################################
115
# Setup CPack RPM
116
########################################################################
117
SET(CPACK_RPM_PACKAGE_REQUIRES "boost-devel, libusb1")
118

    
119
########################################################################
120
INCLUDE(CPack) #include after setting vars