PageRenderTime 47ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/gr-analog/include/gnuradio/analog/CMakeLists.txt

https://github.com/balister/GNU-Radio
CMake | 114 lines | 71 code | 12 blank | 31 comment | 3 complexity | 8605ce82468f13cb46d143f1ace186d2 MD5 | raw file
  1. # Copyright 2012 Free Software Foundation, Inc.
  2. #
  3. # This file is part of GNU Radio
  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. # generate helper scripts to expand templated files
  21. ########################################################################
  22. include(GrPython)
  23. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
  24. #!${PYTHON_EXECUTABLE}
  25. import sys, os, re
  26. sys.path.append('${GR_RUNTIME_PYTHONPATH}')
  27. os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
  28. os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
  29. if __name__ == '__main__':
  30. import build_utils
  31. root, inp = sys.argv[1:3]
  32. for sig in sys.argv[3:]:
  33. name = re.sub ('X+', sig, root)
  34. d = build_utils.standard_dict2(name, sig, 'analog')
  35. build_utils.expand_template(d, inp)
  36. ")
  37. macro(expand_h root)
  38. #make a list of all the generated files
  39. unset(expanded_files_h)
  40. foreach(sig ${ARGN})
  41. string(REGEX REPLACE "X+" ${sig} name ${root})
  42. list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
  43. endforeach(sig)
  44. #create a command to generate the files
  45. add_custom_command(
  46. OUTPUT ${expanded_files_h}
  47. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
  48. COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
  49. ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
  50. ${root} ${root}.h.t ${ARGN}
  51. )
  52. #install rules for the generated h files
  53. list(APPEND generated_includes ${expanded_files_h})
  54. endmacro(expand_h)
  55. ########################################################################
  56. # Invoke macro to generate various sources
  57. #######################################################################
  58. expand_h(noise_source_X s i f c)
  59. expand_h(fastnoise_source_X s i f c)
  60. expand_h(sig_source_X s i f c)
  61. add_custom_target(analog_generated_includes DEPENDS
  62. ${generated_includes}
  63. )
  64. ########################################################################
  65. # Install header files
  66. ########################################################################
  67. install(FILES
  68. ${generated_includes}
  69. api.h
  70. cpm.h
  71. noise_type.h
  72. agc.h
  73. agc2.h
  74. noise_type.h
  75. squelch_base_ff.h
  76. agc_cc.h
  77. agc_ff.h
  78. agc2_cc.h
  79. agc2_ff.h
  80. agc3_cc.h
  81. cpfsk_bc.h
  82. ctcss_squelch_ff.h
  83. dpll_bb.h
  84. feedforward_agc_cc.h
  85. fmdet_cf.h
  86. frequency_modulator_fc.h
  87. phase_modulator_fc.h
  88. pll_carriertracking_cc.h
  89. pll_freqdet_cf.h
  90. pll_refout_cc.h
  91. probe_avg_mag_sqrd_c.h
  92. probe_avg_mag_sqrd_cf.h
  93. probe_avg_mag_sqrd_f.h
  94. pwr_squelch_cc.h
  95. pwr_squelch_ff.h
  96. quadrature_demod_cf.h
  97. rail_ff.h
  98. sig_source_waveform.h
  99. simple_squelch_cc.h
  100. DESTINATION ${GR_INCLUDE_DIR}/gnuradio/analog
  101. COMPONENT "analog_devel"
  102. )