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