Statistics
| Branch: | Tag: | Revision:

root / host / lib / transport / CMakeLists.txt @ fe7df530

History | View | Annotate | Download (3.7 kB)

1
#
2
# Copyright 2010 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
#This file will be included by cmake, use absolute paths!
19

    
20
########################################################################
21
# Setup libusb
22
########################################################################
23
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/lib/transport)
24
FIND_PACKAGE(USB1 REQUIRED)
25

    
26
IF(LIBUSB_FOUND)
27
    INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR})
28
    LIBUHD_APPEND_LIBS(${LIBUSB_LIBRARIES})
29
    LIBUHD_APPEND_SOURCES(
30
        ${CMAKE_SOURCE_DIR}/lib/transport/libusb1_control.cpp
31
        ${CMAKE_SOURCE_DIR}/lib/transport/libusb1_zero_copy.cpp
32
        ${CMAKE_SOURCE_DIR}/lib/transport/libusb1_base.cpp
33
        ${CMAKE_SOURCE_DIR}/lib/transport/libusb1_device_handle.cpp
34
    )
35
    SET(HAVE_USB_SUPPORT TRUE)
36
ENDIF(LIBUSB_FOUND)
37

    
38
########################################################################
39
# Check for SIMD headers
40
########################################################################
41
INCLUDE(CheckIncludeFileCXX)
42
CHECK_INCLUDE_FILE_CXX(emmintrin.h HAVE_EMMINTRIN_H)
43

    
44
IF(HAVE_EMMINTRIN_H)
45
    ADD_DEFINITIONS(-DHAVE_EMMINTRIN_H)
46
ENDIF(HAVE_EMMINTRIN_H)
47

    
48
########################################################################
49
# Setup defines for interface address discovery
50
########################################################################
51
MESSAGE(STATUS "Configuring interface address discovery...")
52

    
53
INCLUDE(CheckIncludeFileCXX)
54
CHECK_INCLUDE_FILE_CXX(ifaddrs.h HAVE_IFADDRS_H)
55
CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H)
56

    
57
IF(HAVE_IFADDRS_H)
58
    MESSAGE(STATUS "  Interface address discovery supported through getifaddrs.")
59
    ADD_DEFINITIONS(-DHAVE_IFADDRS_H)
60
ELSEIF(HAVE_WINSOCK2_H)
61
    MESSAGE(STATUS "  Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
62
    ADD_DEFINITIONS(-DHAVE_WINSOCK2_H)
63
ELSE(HAVE_IFADDRS_H)
64
    MESSAGE(STATUS "  Interface address discovery not supported.")
65
ENDIF(HAVE_IFADDRS_H)
66

    
67
########################################################################
68
# Append to the list of sources for lib uhd
69
########################################################################
70
LIBUHD_PYTHON_GEN_SOURCE(
71
    ${CMAKE_SOURCE_DIR}/lib/transport/gen_vrt_if_packet.py
72
    ${CMAKE_BINARY_DIR}/lib/transport/vrt_if_packet.cpp
73
)
74

    
75
LIBUHD_PYTHON_GEN_SOURCE(
76
    ${CMAKE_SOURCE_DIR}/lib/transport/gen_convert_types.py
77
    ${CMAKE_BINARY_DIR}/lib/transport/convert_types.cpp
78
)
79

    
80
# append this directory to the include path so the generated convert types
81
# can include the implementation convert types file in the source directory
82
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/transport)
83

    
84
# make the generated convert types depend on the implementation header
85
SET_SOURCE_FILES_PROPERTIES(
86
    ${CMAKE_BINARY_DIR}/lib/transport/convert_types.cpp PROPERTIES
87
    OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/lib/transport/convert_types_impl.hpp
88
)
89

    
90
LIBUHD_APPEND_SOURCES(
91
    ${CMAKE_SOURCE_DIR}/lib/transport/if_addrs.cpp
92
    ${CMAKE_SOURCE_DIR}/lib/transport/udp_simple.cpp
93
    ${CMAKE_SOURCE_DIR}/lib/transport/udp_zero_copy_asio.cpp
94
    ${CMAKE_SOURCE_DIR}/lib/transport/vrt_packet_handler.hpp
95
    ${CMAKE_SOURCE_DIR}/lib/transport/zero_copy.cpp
96
)