CMakeLists.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. cmake_minimum_required (VERSION 3.6)
  2. project(CMSISDSPTransform)
  3. include(configLib)
  4. include(configDsp)
  5. add_library(CMSISDSPTransform STATIC)
  6. configLib(CMSISDSPTransform ${ROOT})
  7. configDsp(CMSISDSPTransform ${ROOT})
  8. include(fft)
  9. fft(CMSISDSPTransform)
  10. if (CONFIGTABLE AND ALLFFT)
  11. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_ALL_FFT_TABLES)
  12. endif()
  13. target_sources(CMSISDSPTransform PRIVATE arm_bitreversal.c)
  14. target_sources(CMSISDSPTransform PRIVATE arm_bitreversal2.c)
  15. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F32_16 OR CFFT_F32_32 OR CFFT_F32_64 OR CFFT_F32_128 OR CFFT_F32_256 OR CFFT_F32_512
  16. OR CFFT_F32_1024 OR CFFT_F32_2048 OR CFFT_F32_4096)
  17. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_f32.c)
  18. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  19. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix8_f32.c)
  20. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f32.c)
  21. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f32.c)
  22. endif()
  23. if (NOT ARMAC5)
  24. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F16_16 OR CFFT_F16_32 OR CFFT_F16_64 OR CFFT_F16_128 OR CFFT_F16_256 OR CFFT_F16_512
  25. OR CFFT_F16_1024 OR CFFT_F16_2048 OR CFFT_F16_4096)
  26. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_f16.c)
  27. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f16.c)
  28. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f16.c)
  29. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f16.c)
  30. endif()
  31. endif()
  32. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F64_16 OR CFFT_F64_32 OR CFFT_F64_64 OR CFFT_F64_128 OR CFFT_F64_256 OR CFFT_F64_512
  33. OR CFFT_F64_1024 OR CFFT_F64_2048 OR CFFT_F64_4096)
  34. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f64.c)
  35. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f64.c)
  36. endif()
  37. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_Q15_16 OR CFFT_Q15_32 OR CFFT_Q15_64 OR CFFT_Q15_128 OR CFFT_Q15_256 OR CFFT_Q15_512
  38. OR CFFT_Q15_1024 OR CFFT_Q15_2048 OR CFFT_Q15_4096)
  39. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_q15.c)
  40. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  41. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  42. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  43. endif()
  44. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_Q31_16 OR CFFT_Q31_32 OR CFFT_Q31_64 OR CFFT_Q31_128 OR CFFT_Q31_256 OR CFFT_Q31_512
  45. OR CFFT_Q31_1024 OR CFFT_Q31_2048 OR CFFT_Q31_4096)
  46. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_q31.c)
  47. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  48. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  49. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  50. endif()
  51. if (NOT CONFIGTABLE OR ALLFFT)
  52. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q15.c)
  53. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q31.c)
  54. endif()
  55. if (NOT CONFIGTABLE OR ALLFFT OR DCT4_F32_128 OR DCT4_F32_512 OR DCT4_F32_2048 OR DCT4_F32_8192)
  56. target_sources(CMSISDSPTransform PRIVATE arm_dct4_f32.c)
  57. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_f32.c)
  58. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_f32.c)
  59. target_sources(CMSISDSPTransform PRIVATE arm_rfft_f32.c)
  60. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f32.c)
  61. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  62. endif()
  63. if (NOT CONFIGTABLE OR ALLFFT OR DCT4_Q31_128 OR DCT4_Q31_512 OR DCT4_Q31_2048 OR DCT4_Q31_8192)
  64. target_sources(CMSISDSPTransform PRIVATE arm_dct4_q31.c)
  65. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_q31.c)
  66. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q31.c)
  67. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q31.c)
  68. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  69. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  70. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q31.c)
  71. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  72. endif()
  73. if (NOT CONFIGTABLE OR ALLFFT OR ALLFFT OR DCT4_Q15_128 OR DCT4_Q15_512 OR DCT4_Q15_2048 OR DCT4_Q15_8192)
  74. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_q15.c)
  75. target_sources(CMSISDSPTransform PRIVATE arm_dct4_q15.c)
  76. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q15.c)
  77. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q15.c)
  78. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  79. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  80. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q15.c)
  81. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  82. endif()
  83. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F32_32 OR RFFT_FAST_F32_64 OR RFFT_FAST_F32_128
  84. OR RFFT_FAST_F32_256 OR RFFT_FAST_F32_512 OR RFFT_FAST_F32_1024 OR RFFT_FAST_F32_2048
  85. OR RFFT_FAST_F32_4096 )
  86. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f32.c)
  87. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f32.c)
  88. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f32.c)
  89. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f32.c)
  90. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix8_f32.c)
  91. endif()
  92. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F64_32 OR RFFT_FAST_F64_64 OR RFFT_FAST_F64_128
  93. OR RFFT_FAST_F64_256 OR RFFT_FAST_F64_512 OR RFFT_FAST_F64_1024 OR RFFT_FAST_F64_2048
  94. OR RFFT_FAST_F64_4096 )
  95. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f64.c)
  96. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f64.c)
  97. endif()
  98. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_F32_128 OR RFFT_F32_512 OR RFFT_F32_2048 OR RFFT_F32_8192)
  99. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_f32.c)
  100. target_sources(CMSISDSPTransform PRIVATE arm_rfft_f32.c)
  101. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f32.c)
  102. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  103. endif()
  104. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_Q15_32 OR RFFT_Q15_64 OR RFFT_Q15_128 OR RFFT_Q15_256
  105. OR RFFT_Q15_512 OR RFFT_Q15_1024 OR RFFT_Q15_2048 OR RFFT_Q15_4096 OR RFFT_Q15_8192)
  106. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q15.c)
  107. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q15.c)
  108. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  109. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  110. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  111. endif()
  112. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_Q31_32 OR RFFT_Q31_64 OR RFFT_Q31_128 OR RFFT_Q31_256
  113. OR RFFT_Q31_512 OR RFFT_Q31_1024 OR RFFT_Q31_2048 OR RFFT_Q31_4096 OR RFFT_Q31_8192)
  114. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q31.c)
  115. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q31.c)
  116. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  117. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  118. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  119. endif()
  120. # For scipy or wrappers or benchmarks
  121. if (WRAPPER)
  122. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f32.c)
  123. endif()
  124. ### Includes
  125. target_include_directories(CMSISDSPTransform PUBLIC "${DSP}/Include")