CMakeLists.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. cmake_minimum_required (VERSION 3.6)
  2. cmake_policy(SET CMP0077 NEW)
  3. project(CMSISDSP)
  4. # DSP Sources
  5. SET(DSP ${ROOT}/CMSIS/DSP)
  6. list(APPEND CMAKE_MODULE_PATH ${DSP}/Source)
  7. list(APPEND CMAKE_MODULE_PATH ${DSP})
  8. include(configLib)
  9. option(NEON "Neon acceleration" OFF)
  10. option(NEONEXPERIMENTAL "Neon experimental acceleration" OFF)
  11. option(LOOPUNROLL "Loop unrolling" ON)
  12. option(ROUNDING "Rounding" OFF)
  13. option(MATRIXCHECK "Matrix Checks" OFF)
  14. option(HELIUM "Helium acceleration (MVEF and MVEI supported)" OFF)
  15. option(MVEF "MVEF intrinsics supported" OFF)
  16. option(MVEI "MVEI intrinsics supported" OFF)
  17. # Select which parts of the CMSIS-DSP must be compiled.
  18. # There are some dependencies between the parts but they are not tracked
  19. # by this cmake. So, enabling some functions may require to enable some
  20. # other ones.
  21. option(BASICMATH "Basic Math Functions" ON)
  22. option(COMPLEXMATH "Complex Math Functions" ON)
  23. option(CONTROLLER "Controller Functions" ON)
  24. option(FASTMATH "Fast Math Functions" ON)
  25. option(FILTERING "Filtering Functions" ON)
  26. option(MATRIX "Matrix Functions" ON)
  27. option(STATISTICS "Statistics Functions" ON)
  28. option(SUPPORT "Support Functions" ON)
  29. option(TRANSFORM "Transform Functions" ON)
  30. option(SVM "Support Vector Machine Functions" ON)
  31. option(BAYES "Bayesian Estimators" ON)
  32. option(DISTANCE "Distance Functions" ON)
  33. # When OFF it is the default behavior : all tables are included.
  34. option(CONFIGTABLE "Configuration of table allowed" OFF)
  35. # When CONFIGTABLE is ON, select if all interpolation tables must be included
  36. option(ALLFAST "All interpolation tables included" OFF)
  37. # When CONFIGTABLE is ON, select if all FFT tables must be included
  38. option(ALLFFT "All fft tables included" OFF)
  39. # Features which require inclusion of a data table.
  40. # Since some tables may be big, the corresponding feature can be
  41. # disabled.
  42. # Those options are taken into account only when CONFIGTABLE is ON
  43. option(ARM_COS_F32 "cos f32" OFF)
  44. option(ARM_COS_Q31 "cos q31" OFF)
  45. option(ARM_COS_Q15 "cos q15" OFF)
  46. option(ARM_SIN_F32 "sin f32" OFF)
  47. option(ARM_SIN_Q31 "sin q31" OFF)
  48. option(ARM_SIN_Q15 "sin q15" OFF)
  49. option(ARM_SIN_COS_F32 "sin cos f32" OFF)
  50. option(ARM_SIN_COS_Q31 "sin cos q31" OFF)
  51. option(ARM_LMS_NORM_Q31 "lms norm q31" OFF)
  52. option(ARM_LMS_NORM_Q15 "lms norm q15" OFF)
  53. option(CFFT_F64_16 "cfft f64 16" OFF)
  54. option(CFFT_F64_32 "cfft f64 32" OFF)
  55. option(CFFT_F64_64 "cfft f64 64" OFF)
  56. option(CFFT_F64_128 "cfft f64 128" OFF)
  57. option(CFFT_F64_256 "cfft f64 256" OFF)
  58. option(CFFT_F64_512 "cfft f64 512" OFF)
  59. option(CFFT_F64_1024 "cfft f64 1024" OFF)
  60. option(CFFT_F64_2048 "cfft f64 2048" OFF)
  61. option(CFFT_F64_4096 "cfft f64 4096" OFF)
  62. option(CFFT_F32_16 "cfft f32 16" OFF)
  63. option(CFFT_F32_32 "cfft f32 32" OFF)
  64. option(CFFT_F32_64 "cfft f32 64" OFF)
  65. option(CFFT_F32_128 "cfft f32 128" OFF)
  66. option(CFFT_F32_256 "cfft f32 256" OFF)
  67. option(CFFT_F32_512 "cfft f32 512" OFF)
  68. option(CFFT_F32_1024 "cfft f32 1024" OFF)
  69. option(CFFT_F32_2048 "cfft f32 2048" OFF)
  70. option(CFFT_F32_4096 "cfft f32 4096" OFF)
  71. option(CFFT_Q31_16 "cfft q31 16" OFF)
  72. option(CFFT_Q31_32 "cfft q31 32" OFF)
  73. option(CFFT_Q31_64 "cfft q31 64" OFF)
  74. option(CFFT_Q31_128 "cfft q31 128" OFF)
  75. option(CFFT_Q31_256 "cfft q31 256" OFF)
  76. option(CFFT_Q31_512 "cfft q31 512" OFF)
  77. option(CFFT_Q31_1024 "cfft q31 1024" OFF)
  78. option(CFFT_Q31_2048 "cfft q31 2048" OFF)
  79. option(CFFT_Q31_4096 "cfft q31 4096" OFF)
  80. option(CFFT_Q15_16 "cfft q15 16" OFF)
  81. option(CFFT_Q15_32 "cfft q15 32" OFF)
  82. option(CFFT_Q15_64 "cfft q15 64" OFF)
  83. option(CFFT_Q15_128 "cfft q15 128" OFF)
  84. option(CFFT_Q15_256 "cfft q15 256" OFF)
  85. option(CFFT_Q15_512 "cfft q15 512" OFF)
  86. option(CFFT_Q15_1024 "cfft q15 1024" OFF)
  87. option(CFFT_Q15_2048 "cfft q15 2048" OFF)
  88. option(CFFT_Q15_4096 "cfft q15 4096" OFF)
  89. option(RFFT_FAST_F32_32 "rfft fast f32 32" OFF)
  90. option(RFFT_FAST_F32_64 "rfft fast f32 64" OFF)
  91. option(RFFT_FAST_F32_128 "rfft fast f32 128" OFF)
  92. option(RFFT_FAST_F32_256 "rfft fast f32 256" OFF)
  93. option(RFFT_FAST_F32_512 "rfft fast f32 512" OFF)
  94. option(RFFT_FAST_F32_1024 "rfft fast f32 1024" OFF)
  95. option(RFFT_FAST_F32_2048 "rfft fast f32 2048" OFF)
  96. option(RFFT_FAST_F32_4096 "rfft fast f32 4096" OFF)
  97. option(RFFT_F32_128 "rfft f32 128" OFF)
  98. option(RFFT_F32_512 "rfft f32 512" OFF)
  99. option(RFFT_F32_2048 "rfft f32 2048" OFF)
  100. option(RFFT_F32_8192 "rfft f32 8192" OFF)
  101. option(RFFT_FAST_F64_32 "rfft fast f64 32" OFF)
  102. option(RFFT_FAST_F64_64 "rfft fast f64 64" OFF)
  103. option(RFFT_FAST_F64_128 "rfft fast f64 128" OFF)
  104. option(RFFT_FAST_F64_256 "rfft fast f64 256" OFF)
  105. option(RFFT_FAST_F64_512 "rfft fast f64 512" OFF)
  106. option(RFFT_FAST_F64_1024 "rfft fast f64 1024" OFF)
  107. option(RFFT_FAST_F64_2048 "rfft fast f64 2048" OFF)
  108. option(RFFT_FAST_F64_4096 "rfft fast f64 4096" OFF)
  109. option(RFFT_F64_128 "rfft f64 128" OFF)
  110. option(RFFT_F64_512 "rfft f64 512" OFF)
  111. option(RFFT_F64_2048 "rfft f64 2048" OFF)
  112. option(RFFT_F64_8192 "rfft f64 8192" OFF)
  113. option(RFFT_Q31_32 "rfft q31 32" OFF)
  114. option(RFFT_Q31_64 "rfft q31 64" OFF)
  115. option(RFFT_Q31_128 "rfft q31 128" OFF)
  116. option(RFFT_Q31_256 "rfft q31 256" OFF)
  117. option(RFFT_Q31_512 "rfft q31 512" OFF)
  118. option(RFFT_Q31_1024 "rfft q31 1024" OFF)
  119. option(RFFT_Q31_2048 "rfft q31 2048" OFF)
  120. option(RFFT_Q31_4096 "rfft q31 4096" OFF)
  121. option(RFFT_Q31_8192 "rfft q31 8192" OFF)
  122. option(RFFT_Q15_32 "rfft q15 32" OFF)
  123. option(RFFT_Q15_64 "rfft q15 64" OFF)
  124. option(RFFT_Q15_128 "rfft q15 128" OFF)
  125. option(RFFT_Q15_256 "rfft q15 256" OFF)
  126. option(RFFT_Q15_512 "rfft q15 512" OFF)
  127. option(RFFT_Q15_1024 "rfft q15 1024" OFF)
  128. option(RFFT_Q15_2048 "rfft q15 2048" OFF)
  129. option(RFFT_Q15_4096 "rfft q15 4096" OFF)
  130. option(RFFT_Q15_8192 "rfft q15 8192" OFF)
  131. option(DCT4_F32_128 "dct4 f32 128" OFF)
  132. option(DCT4_F32_512 "dct4 f32 512" OFF)
  133. option(DCT4_F32_2048 "dct4 f32 2048" OFF)
  134. option(DCT4_F32_8192 "dct4 f32 8192" OFF)
  135. option(DCT4_Q31_128 "dct4 q31 128" OFF)
  136. option(DCT4_Q31_512 "dct4 q31 512" OFF)
  137. option(DCT4_Q31_2048 "dct4 q31 2048" OFF)
  138. option(DCT4_Q31_8192 "dct4 q31 8192" OFF)
  139. option(DCT4_Q15_128 "dct4 q15 128" OFF)
  140. option(DCT4_Q15_512 "dct4 q15 512" OFF)
  141. option(DCT4_Q15_2048 "dct4 q15 2048" OFF)
  142. option(DCT4_Q15_8192 "dct4 q15 8192" OFF)
  143. ###########################
  144. #
  145. # CMSIS DSP
  146. #
  147. ###########################
  148. add_library(CMSISDSP INTERFACE)
  149. if (BASICMATH)
  150. add_subdirectory(BasicMathFunctions)
  151. target_link_libraries(CMSISDSP INTERFACE CMSISDSPBasicMath)
  152. endif()
  153. if (COMPLEXMATH)
  154. add_subdirectory(ComplexMathFunctions)
  155. target_link_libraries(CMSISDSP INTERFACE CMSISDSPComplexMath)
  156. endif()
  157. if (CONTROLLER)
  158. add_subdirectory(ControllerFunctions)
  159. # Fast tables inclusion is allowed
  160. if (CONFIGTABLE)
  161. target_compile_definitions(CMSISDSPController PUBLIC ARM_FAST_ALLOW_TABLES)
  162. endif()
  163. target_link_libraries(CMSISDSP INTERFACE CMSISDSPController)
  164. endif()
  165. if (FASTMATH)
  166. add_subdirectory(FastMathFunctions)
  167. # Fast tables inclusion is allowed
  168. if (CONFIGTABLE)
  169. target_compile_definitions(CMSISDSPFastMath PUBLIC ARM_FAST_ALLOW_TABLES)
  170. endif()
  171. target_link_libraries(CMSISDSP INTERFACE CMSISDSPFastMath)
  172. endif()
  173. if (FILTERING)
  174. add_subdirectory(FilteringFunctions)
  175. # Fast tables inclusion is allowed
  176. if (CONFIGTABLE)
  177. target_compile_definitions(CMSISDSPFiltering PUBLIC ARM_FAST_ALLOW_TABLES)
  178. endif()
  179. target_link_libraries(CMSISDSP INTERFACE CMSISDSPFiltering)
  180. endif()
  181. if (MATRIX)
  182. add_subdirectory(MatrixFunctions)
  183. target_link_libraries(CMSISDSP INTERFACE CMSISDSPMatrix)
  184. endif()
  185. if (STATISTICS)
  186. add_subdirectory(StatisticsFunctions)
  187. target_link_libraries(CMSISDSP INTERFACE CMSISDSPStatistics)
  188. endif()
  189. if (SUPPORT)
  190. add_subdirectory(SupportFunctions)
  191. target_link_libraries(CMSISDSP INTERFACE CMSISDSPSupport)
  192. endif()
  193. if (TRANSFORM)
  194. add_subdirectory(TransformFunctions)
  195. # FFT tables inclusion is allowed
  196. if (CONFIGTABLE)
  197. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_FFT_ALLOW_TABLES)
  198. endif()
  199. target_link_libraries(CMSISDSP INTERFACE CMSISDSPTransform)
  200. endif()
  201. if (FILTERING OR CONTROLLER OR FASTMATH OR TRANSFORM OR SVM OR DISTANCE)
  202. add_subdirectory(CommonTables)
  203. if (TRANSFORM)
  204. # FFT tables inclusion is allowed
  205. if (CONFIGTABLE)
  206. target_compile_definitions(CMSISDSPCommon PUBLIC ARM_FFT_ALLOW_TABLES)
  207. endif()
  208. endif()
  209. if (FILTERING OR CONTROLLER OR FASTMATH)
  210. # Select which tables to include
  211. if (CONFIGTABLE)
  212. target_compile_definitions(CMSISDSPCommon PUBLIC ARM_FAST_ALLOW_TABLES)
  213. endif()
  214. endif()
  215. target_link_libraries(CMSISDSP INTERFACE CMSISDSPCommon)
  216. # Common project is adding ComputeLibrary tables used by SVM and Distance
  217. # when NEon is ON.
  218. endif()
  219. if (SVM)
  220. add_subdirectory(SVMFunctions)
  221. target_link_libraries(CMSISDSP INTERFACE CMSISDSPSVM)
  222. endif()
  223. if (BAYES)
  224. add_subdirectory(BayesFunctions)
  225. target_link_libraries(CMSISDSP INTERFACE CMSISDSPBayes)
  226. endif()
  227. if (DISTANCE)
  228. add_subdirectory(DistanceFunctions)
  229. target_link_libraries(CMSISDSP INTERFACE CMSISDSPDistance)
  230. endif()
  231. ### Includes
  232. target_include_directories(CMSISDSP INTERFACE "${DSP}/Include")