[USRP-users] ENABLE_RFNOC=ON question

Rob Kossler rkossler at nd.edu
Wed Feb 20 11:50:58 EST 2019


Hi,
I have an out-of-tree project with a CMakeLists.txt that contains the
following code:

if(ENABLE_RFNOC)
  add_definitions(-DUHD_RFNOC_ENABLED)
  add_executable(my_app my_app.cpp rfnoc_functions.cpp)
else(ENABLE_RFNOC)
  add_executable(my_app my_app.cpp)
endif(ENABLE_RFNOC

This works fine if I run the cmake command such as ...
  cmake ../ -DENABLE_RFNOC=ON

However, I am wondering if there is a better way to do it such that the
user doesn't have to specify this option given that the user has already
specified it when building UHD.  At the time I run the out-of-tree cmake,
the environment variables have already been setup to find the appropriate
UHD library which has already been compiled either with or without that
option.

Is it possible to find this information automatically rather than require
the user to specify it again in the out-of-tree cmake?

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20190220/490163b2/attachment.html>


More information about the USRP-users mailing list