aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-06 19:57:09 +0000
committerJosh Blum <josh@joshknows.com>2010-05-06 19:57:09 +0000
commit7790eeb944f7eace8fae16b80820f71dd5bc3a87 (patch)
treec8c6344ba59b91660f5a52aa1c73a61f645ed5dd /host/lib
parentfae1f9ab670502cc2ee5ec20cd0a1d00456339ac (diff)
parent1acc7467e833e5364cdcb1ba90951daf23cac656 (diff)
downloaduhd-7790eeb944f7eace8fae16b80820f71dd5bc3a87.tar.gz
uhd-7790eeb944f7eace8fae16b80820f71dd5bc3a87.tar.bz2
uhd-7790eeb944f7eace8fae16b80820f71dd5bc3a87.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/CMakeLists.txt143
-rw-r--r--host/lib/ic_reg_maps/CMakeLists.txt65
-rw-r--r--host/lib/transport/CMakeLists.txt52
-rw-r--r--host/lib/usrp/CMakeLists.txt27
-rw-r--r--host/lib/usrp/dboard/CMakeLists.txt26
-rw-r--r--host/lib/usrp/usrp2/CMakeLists.txt29
6 files changed, 221 insertions, 121 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index be57699fc..f64f1dbac 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-
########################################################################
# Setup Python
########################################################################
@@ -43,30 +42,13 @@ IF(NOT HAVE_PYTHON_MODULE_CHEETAH)
ENDIF(NOT HAVE_PYTHON_MODULE_CHEETAH)
########################################################################
-# Create a list of libuhd sources
+# Helpful Macros
########################################################################
-SET(libuhd_sources
- device.cpp
- gain_handler.cpp
- load_modules.cpp
- types.cpp
- utils.cpp
- wax.cpp
- transport/convert_types.cpp
- transport/if_addrs.cpp
- transport/udp_simple.cpp
- usrp/dboard_base.cpp
- usrp/dboard_eeprom.cpp
- usrp/dboard_id.cpp
- usrp/dboard_manager.cpp
- usrp/simple_usrp.cpp
- usrp/tune_helper.cpp
-)
+MACRO(LIBUHD_APPEND_SOURCES)
+ LIST(APPEND libuhd_sources ${ARGV})
+ENDMACRO(LIBUHD_APPEND_SOURCES)
-########################################################################
-# Generate Files
-########################################################################
-MACRO(UHD_PYTHON_GEN_SOURCE_FILE pyfile outfile)
+MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile)
#ensure that the directory exists for outfile
GET_FILENAME_COMPONENT(outfile_dir ${outfile} PATH)
FILE(MAKE_DIRECTORY ${outfile_dir})
@@ -79,91 +61,17 @@ MACRO(UHD_PYTHON_GEN_SOURCE_FILE pyfile outfile)
)
#make libuhd depend on the outfile
- LIST(APPEND libuhd_sources ${outfile})
-ENDMACRO(UHD_PYTHON_GEN_SOURCE_FILE)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/transport/gen_vrt.py
- ${CMAKE_CURRENT_BINARY_DIR}/transport/vrt.cpp
-)
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_adf4350_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/adf4350_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_adf4360_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/adf4360_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad9510_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad9510_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad9777_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad9777_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad5624_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad5624_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad7922_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad7922_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_max2829_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/max2829_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad9862_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad9862_regs.hpp
-)
-
-UHD_PYTHON_GEN_SOURCE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/gen_ad9522_regs.py
- ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/ad9522_regs.hpp
-)
-
-########################################################################
-# Add dboard sources
-########################################################################
-LIST(APPEND libuhd_sources
- usrp/dboard/db_basic_and_lf.cpp
- usrp/dboard/db_rfx.cpp
- usrp/dboard/db_xcvr2450.cpp
- usrp/dboard/db_wbx.cpp
-)
+ LIBUHD_APPEND_SOURCES(${outfile})
+ENDMACRO(LIBUHD_PYTHON_GEN_SOURCE)
########################################################################
-# Add usrp2 sources
+# Include CMakeLists.txt from subdirectories
########################################################################
-LIST(APPEND libuhd_sources
- usrp/usrp2/clock_control.cpp
- usrp/usrp2/dboard_impl.cpp
- usrp/usrp2/dboard_iface.cpp
- usrp/usrp2/dsp_impl.cpp
- usrp/usrp2/io_impl.cpp
- usrp/usrp2/mboard_impl.cpp
- usrp/usrp2/usrp2_iface.cpp
- usrp/usrp2/usrp2_impl.cpp
-)
-
-########################################################################
-# Conditionally add the udp sources
-########################################################################
-LIST(APPEND libuhd_sources
- transport/udp_zero_copy_asio.cpp
-)
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/CMakeLists.txt)
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/transport/CMakeLists.txt)
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/usrp/CMakeLists.txt)
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/usrp/dboard/CMakeLists.txt)
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/usrp/usrp2/CMakeLists.txt)
########################################################################
# Conditionally add the usrp1e sources
@@ -221,23 +129,16 @@ ELSE(HAVE_DLFCN_H)
ENDIF(HAVE_DLFCN_H)
########################################################################
-# Setup defines for interface address discovery
+# Append to the list of sources for lib uhd
########################################################################
-MESSAGE(STATUS "Configuring interface address discovery...")
-
-INCLUDE(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(ifaddrs.h HAVE_IFADDRS_H)
-CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H)
-
-IF(HAVE_IFADDRS_H)
- MESSAGE(STATUS " Interface address discovery supported through getifaddrs.")
- ADD_DEFINITIONS(-DHAVE_IFADDRS_H)
-ELSEIF(HAVE_WINSOCK2_H)
- MESSAGE(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
- ADD_DEFINITIONS(-DHAVE_WINSOCK2_H)
-ELSE(HAVE_IFADDRS_H)
- MESSAGE(STATUS " Interface address discovery not supported.")
-ENDIF(HAVE_IFADDRS_H)
+LIBUHD_APPEND_SOURCES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/gain_handler.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/load_modules.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/types.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/wax.cpp
+)
########################################################################
# Setup libuhd library
diff --git a/host/lib/ic_reg_maps/CMakeLists.txt b/host/lib/ic_reg_maps/CMakeLists.txt
new file mode 100644
index 000000000..63378eb89
--- /dev/null
+++ b/host/lib/ic_reg_maps/CMakeLists.txt
@@ -0,0 +1,65 @@
+#
+# Copyright 2010 Ettus Research LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#This file will be included by cmake, use absolute paths!
+
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/lib/ic_reg_maps)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_adf4350_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/adf4350_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_adf4360_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/adf4360_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad9510_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad9510_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad9777_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad9777_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad5624_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad5624_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad7922_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad7922_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_max2829_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/max2829_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad9862_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad9862_regs.hpp
+)
+
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/ic_reg_maps/gen_ad9522_regs.py
+ ${CMAKE_BINARY_DIR}/lib/ic_reg_maps/ad9522_regs.hpp
+)
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
new file mode 100644
index 000000000..a36f0fc03
--- /dev/null
+++ b/host/lib/transport/CMakeLists.txt
@@ -0,0 +1,52 @@
+#
+# Copyright 2010 Ettus Research LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#This file will be included by cmake, use absolute paths!
+
+########################################################################
+# Setup defines for interface address discovery
+########################################################################
+MESSAGE(STATUS "Configuring interface address discovery...")
+
+INCLUDE(CheckIncludeFileCXX)
+CHECK_INCLUDE_FILE_CXX(ifaddrs.h HAVE_IFADDRS_H)
+CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H)
+
+IF(HAVE_IFADDRS_H)
+ MESSAGE(STATUS " Interface address discovery supported through getifaddrs.")
+ ADD_DEFINITIONS(-DHAVE_IFADDRS_H)
+ELSEIF(HAVE_WINSOCK2_H)
+ MESSAGE(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
+ ADD_DEFINITIONS(-DHAVE_WINSOCK2_H)
+ELSE(HAVE_IFADDRS_H)
+ MESSAGE(STATUS " Interface address discovery not supported.")
+ENDIF(HAVE_IFADDRS_H)
+
+########################################################################
+# Append to the list of sources for lib uhd
+########################################################################
+LIBUHD_PYTHON_GEN_SOURCE(
+ ${CMAKE_SOURCE_DIR}/lib/transport/gen_vrt.py
+ ${CMAKE_BINARY_DIR}/lib/transport/vrt.cpp
+)
+
+LIBUHD_APPEND_SOURCES(
+ ${CMAKE_SOURCE_DIR}/lib/transport/convert_types.cpp
+ ${CMAKE_SOURCE_DIR}/lib/transport/if_addrs.cpp
+ ${CMAKE_SOURCE_DIR}/lib/transport/udp_simple.cpp
+ ${CMAKE_SOURCE_DIR}/lib/transport/udp_zero_copy_asio.cpp
+)
diff --git a/host/lib/usrp/CMakeLists.txt b/host/lib/usrp/CMakeLists.txt
new file mode 100644
index 000000000..39a72ab37
--- /dev/null
+++ b/host/lib/usrp/CMakeLists.txt
@@ -0,0 +1,27 @@
+#
+# Copyright 2010 Ettus Research LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#This file will be included by cmake, use absolute paths!
+
+LIBUHD_APPEND_SOURCES(
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard_base.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard_eeprom.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard_id.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard_manager.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/simple_usrp.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/tune_helper.cpp
+)
diff --git a/host/lib/usrp/dboard/CMakeLists.txt b/host/lib/usrp/dboard/CMakeLists.txt
new file mode 100644
index 000000000..3a6c2d84a
--- /dev/null
+++ b/host/lib/usrp/dboard/CMakeLists.txt
@@ -0,0 +1,26 @@
+#
+# Copyright 2010 Ettus Research LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#This file will be included by cmake, use absolute paths!
+
+LIBUHD_APPEND_SOURCES(
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/db_basic_and_lf.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/db_rfx.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/db_xcvr2450.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/db_wbx.cpp
+)
+
diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt
new file mode 100644
index 000000000..f9907e21e
--- /dev/null
+++ b/host/lib/usrp/usrp2/CMakeLists.txt
@@ -0,0 +1,29 @@
+#
+# Copyright 2010 Ettus Research LLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+#This file will be included by cmake, use absolute paths!
+
+LIBUHD_APPEND_SOURCES(
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/clock_control.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_iface.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dsp_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/io_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/mboard_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_iface.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_impl.cpp
+)