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