diff options
-rw-r--r-- | host/utils/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/nirio_programmer/.gitignore | 1 | ||||
-rw-r--r-- | tools/nirio_programmer/CMakeLists.txt | 83 | ||||
-rw-r--r-- | tools/nirio_programmer/nirio_programmer.cpp (renamed from host/utils/nirio_programmer.cpp) | 16 |
4 files changed, 100 insertions, 1 deletions
diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index 2f61c3c2e..530bcf087 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -26,7 +26,6 @@ SET(util_runtime_sources uhd_cal_tx_dc_offset.cpp uhd_cal_tx_iq_balance.cpp usrp_n2xx_simple_net_burner.cpp - nirio_programmer.cpp ) SET(x3xx_burner_sources diff --git a/tools/nirio_programmer/.gitignore b/tools/nirio_programmer/.gitignore new file mode 100644 index 000000000..567609b12 --- /dev/null +++ b/tools/nirio_programmer/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/tools/nirio_programmer/CMakeLists.txt b/tools/nirio_programmer/CMakeLists.txt new file mode 100644 index 000000000..bde0ea574 --- /dev/null +++ b/tools/nirio_programmer/CMakeLists.txt @@ -0,0 +1,83 @@ +# +# Copyright 2014-2015 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/>. +# + +cmake_minimum_required(VERSION 2.8) + +### Set up build environment ################################################## +# Choose a static or shared-library build (shared is default, and static will +# probably need some special care!) +# Set this to ON in order to link a static build of UHD: +option(UHD_USE_STATIC_LIBS OFF) + +# This example also requires Boost: +set(BOOST_REQUIRED_COMPONENTS + program_options + system + thread + regex +) +if(MSVC) + set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") + if(BOOST_ALL_DYN_LINK) + add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc + else(BOOST_ALL_DYN_LINK) + set(BOOST_REQUIRED_COMPONENTS) #empty components list for static link + endif(BOOST_ALL_DYN_LINK) +endif(MSVC) +find_package(Boost "1.46" REQUIRED ${BOOST_REQUIRED_COMPONENTS}) + +# To add UHD as a dependency to this project, add a line such as this: +find_package(UHD "3.8.0" REQUIRED) +# The version in ^^^^^ here is a minimum version. +# To specify an exact version: +#find_package(UHD 3.8.1 EXACT REQUIRED) + +### Configure Compiler ######################################################## +include_directories( + "${CMAKE_CURRENT_SOURCE_DIR}/../../host/include" + ${Boost_INCLUDE_DIRS} + ${UHD_INCLUDE_DIRS} +) +link_directories(${Boost_LIBRARY_DIRS}) + +### Make the executable ####################################################### +add_executable(nirio_programmer nirio_programmer.cpp) + +SET(CMAKE_BUILD_TYPE "Release") + +# Shared library case: All we need to do is link against the library, and +# anything else we need (in this case, some Boost libraries): +if(NOT UHD_USE_STATIC_LIBS) + message(STATUS "Linking against shared UHD library.") + target_link_libraries(nirio_programmer ${UHD_LIBRARIES} ${Boost_LIBRARIES}) +# Shared library case: All we need to do is link against the library, and +# anything else we need (in this case, some Boost libraries): +else(NOT UHD_USE_STATIC_LIBS) + message(STATUS "Linking against static UHD library.") + target_link_libraries(nirio_programmer + # We could use ${UHD_LIBRARIES}, but linking requires some extra flags, + # so we use this convenience variable provided to us + ${UHD_STATIC_LIB_LINK_FLAG} + # Also, when linking statically, we need to pull in all the deps for + # UHD as well, because the dependencies don't get resolved automatically + ${UHD_STATIC_LIB_DEPS} + ) +endif(NOT UHD_USE_STATIC_LIBS) + +### Once it's built... ######################################################## +# Here, you would have commands to install your program. +# We will skip these in this example. diff --git a/host/utils/nirio_programmer.cpp b/tools/nirio_programmer/nirio_programmer.cpp index c8c5e72d3..9bb83e9a4 100644 --- a/host/utils/nirio_programmer.cpp +++ b/tools/nirio_programmer/nirio_programmer.cpp @@ -1,3 +1,19 @@ +// +// Copyright 2014 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/>. +// #include <uhd/transport/nirio/niusrprio_session.h> #include <uhd/transport/nirio/niriok_proxy.h> |