aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/CMakeLists.txt
diff options
context:
space:
mode:
authorSamuel O'Brien <sam.obrien@ni.com>2020-07-31 13:43:43 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-07 15:29:19 -0500
commit6394a7c6ea395e2d21c3e2b9e43e1b2dc84666b5 (patch)
treee5c230efe4781ac294641464d99cf51b6bf44024 /mpm/python/CMakeLists.txt
parent1bb603fffdbdcc87f7c26809d495ced7a5afc93b (diff)
downloaduhd-6394a7c6ea395e2d21c3e2b9e43e1b2dc84666b5.tar.gz
uhd-6394a7c6ea395e2d21c3e2b9e43e1b2dc84666b5.tar.bz2
uhd-6394a7c6ea395e2d21c3e2b9e43e1b2dc84666b5.zip
sim: Lay Groundwork for Simulator
At this point, only about half of the mpm methods work on the simulator over the mpm shell, and it hasn't been tested with uhd at all. If you want to give it a try, first install all of the python dependencies of mpm (The simulator doesn't require libusrp or any of the C++ deps). In addition, running mpm on a desktop machine requires the python lib netifaces. Next, make an /mpm/build directory and open it. Run `cmake .. -DMPM_DEVICE=sim`, then `make`. Finally, run `python3 python/usrp_hwd.py`. You should be able to open another terminal and run `mpm/tools/mpm_shell.py localhost` to connect to the mpm server. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'mpm/python/CMakeLists.txt')
-rw-r--r--mpm/python/CMakeLists.txt23
1 files changed, 14 insertions, 9 deletions
diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt
index 5691a67a2..b1bc9fa16 100644
--- a/mpm/python/CMakeLists.txt
+++ b/mpm/python/CMakeLists.txt
@@ -16,15 +16,17 @@ elseif(MPM_DEVICE STREQUAL "e31x")
add_library(pyusrp_periphs SHARED pyusrp_periphs/e31x/pyusrp_periphs.cpp)
endif(MPM_DEVICE STREQUAL "n3xx")
-target_include_directories(pyusrp_periphs PUBLIC
- ${PYTHON_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}/lib/
- ${UHD_HOST_ROOT}/lib/usrp/common
- ${UHD_HOST_ROOT}/lib/usrp/common/ad9361_driver
- ${UHD_HOST_ROOT}/lib/deps/pybind11/include
-)
-target_link_libraries(pyusrp_periphs ${Boost_LIBRARIES} usrp-periphs)
-add_custom_command(TARGET pyusrp_periphs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libpyusrp_periphs.so ${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/libpyusrp_periphs.so)
+if(NOT ENABLE_SIM)
+ target_include_directories(pyusrp_periphs PUBLIC
+ ${PYTHON_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/lib/
+ ${UHD_HOST_ROOT}/lib/usrp/common
+ ${UHD_HOST_ROOT}/lib/usrp/common/ad9361_driver
+ ${UHD_HOST_ROOT}/lib/deps/pybind11/include
+ )
+ target_link_libraries(pyusrp_periphs ${Boost_LIBRARIES} usrp-periphs)
+ add_custom_command(TARGET pyusrp_periphs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libpyusrp_periphs.so ${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/libpyusrp_periphs.so)
+endif(NOT ENABLE_SIM)
set(USRP_MPM_FILES "")
add_subdirectory(usrp_mpm)
@@ -34,9 +36,12 @@ set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
set(PERIPH_MGR_INIT_IN "${CMAKE_CURRENT_SOURCE_DIR}/usrp_mpm/periph_manager/__init__.py.in")
set(PERIPH_MGR_INIT "${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/periph_manager/__init__.py")
+set(USRP_MPM_INIT_IN "${CMAKE_CURRENT_SOURCE_DIR}/usrp_mpm/__init__.py.in")
+set(USRP_MPM_INIT "${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/__init__.py")
configure_file(${SETUP_PY_IN} ${SETUP_PY})
configure_file(${PERIPH_MGR_INIT_IN} ${PERIPH_MGR_INIT})
+configure_file(${USRP_MPM_INIT_IN} ${USRP_MPM_INIT})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/usrp_hwd.py" "${CMAKE_CURRENT_BINARY_DIR}/usrp_hwd.py" COPYONLY)
add_custom_command(OUTPUT ${OUTPUT}