diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-12 15:19:25 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-12 15:19:25 -0700 |
commit | b87d9afe82e962718f5f5d514abf9d79b9603b98 (patch) | |
tree | caa53a69eaa9847994737748c1385a2dfd3153f8 /host/lib/CMakeLists.txt | |
parent | 24ca9fbd0784c7c53af6ad4f9035e8d43e888290 (diff) | |
parent | fa96b25b99dbd19ac0689cab9bcab84063287ad3 (diff) | |
download | uhd-b87d9afe82e962718f5f5d514abf9d79b9603b98.tar.gz uhd-b87d9afe82e962718f5f5d514abf9d79b9603b98.tar.bz2 uhd-b87d9afe82e962718f5f5d514abf9d79b9603b98.zip |
Merge branch 'rfx' of git@ettus.sourcerepo.com:ettus/uhd into io
Conflicts:
host/lib/usrp/usrp2/io_impl.cpp
Diffstat (limited to 'host/lib/CMakeLists.txt')
-rw-r--r-- | host/lib/CMakeLists.txt | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index fac1bd19f..52ed809ab 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -15,6 +15,33 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # + +######################################################################## +# Setup Python +######################################################################## +INCLUDE(FindPythonInterp) + +MACRO(PYTHON_CHECK_MODULE module have) + MESSAGE(STATUS "Checking for python module ${module}") + EXECUTE_PROCESS( + COMMAND ${PYTHON_EXECUTABLE} -c "import ${module}" + RESULT_VARIABLE ${have} + ) + IF(${have} EQUAL 0) + MESSAGE(STATUS "Checking for python module ${module} - found") + SET(${have} TRUE) + ELSE(${have} EQUAL 0) + MESSAGE(STATUS "Checking for python module ${module} - not found") + SET(${have} FALSE) + ENDIF(${have} EQUAL 0) +ENDMACRO(PYTHON_CHECK_MODULE) + +PYTHON_CHECK_MODULE("Cheetah" HAVE_PYTHON_MODULE_CHEETAH) + +IF(NOT HAVE_PYTHON_MODULE_CHEETAH) + MESSAGE(FATAL_ERROR "Error: Cheetah Templates needed for pre-build generation.") +ENDIF(NOT HAVE_PYTHON_MODULE_CHEETAH) + ######################################################################## # Create a list of libuhd sources ######################################################################## @@ -27,10 +54,9 @@ SET(libuhd_sources transport/convert_types.cpp transport/if_addrs.cpp transport/udp_simple.cpp - transport/vrt.cpp usrp/dboard/db_basic_and_lf.cpp + usrp/dboard/db_rfx.cpp usrp/dboard_base.cpp - usrp/dboard_interface.cpp usrp/simple_usrp.cpp usrp/dboard_manager.cpp usrp/tune_helper.cpp @@ -43,6 +69,30 @@ SET(libuhd_sources ) ######################################################################## +# Generate Files +######################################################################## +MACRO(UHD_PYTHON_GEN_SOURCE_FILE pyfile outfile) + ADD_CUSTOM_COMMAND( + OUTPUT ${outfile} DEPENDS ${pyfile} + COMMAND ${PYTHON_EXECUTABLE} ${pyfile} ${outfile} + COMMENT "Calling ${pyfile} to generate ${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_adf4360_regs.py + ${CMAKE_CURRENT_BINARY_DIR}/ic_reg_maps/adf4360_regs.hpp +) + +######################################################################## # Conditionally add the udp sources ######################################################################## LIST(APPEND libuhd_sources |