CMakeLists.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright 2012 OSMOCOM Project
  2. #
  3. # This file is part of rtl-sdr
  4. #
  5. # GNU Radio is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3, or (at your option)
  8. # any later version.
  9. #
  10. # GNU Radio is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with GNU Radio; see the file COPYING. If not, write to
  17. # the Free Software Foundation, Inc., 51 Franklin Street,
  18. # Boston, MA 02110-1301, USA.
  19. ########################################################################
  20. # Setup library
  21. ########################################################################
  22. add_library(rtlsdr SHARED
  23. rtl-sdr.c
  24. tuner_e4000.c
  25. tuner_fc0012.c
  26. tuner_fc0013.c
  27. )
  28. target_link_libraries(rtlsdr
  29. ${LIBUSB_LIBRARIES}
  30. )
  31. set_target_properties(rtlsdr PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS")
  32. ########################################################################
  33. # Install built library files
  34. ########################################################################
  35. install(TARGETS rtlsdr
  36. LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
  37. ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
  38. RUNTIME DESTINATION bin # .dll file
  39. )
  40. ########################################################################
  41. # Build utility
  42. ########################################################################
  43. add_executable(rtl_sdr main.c)
  44. target_link_libraries(rtl_sdr rtlsdr ${LIBUSB_LIBRARIES})