CMakeLists.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. cmake_minimum_required (VERSION 3.14)
  2. cmake_policy(SET CMP0077 NEW)
  3. include(CMakePrintHelpers)
  4. # The tests are assuming that MATRIX_CHECK is enabled when building
  5. # CMSIS-DSP.
  6. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/..)
  7. function(writeConfig path)
  8. set(output "")
  9. list(APPEND output "OPTIMIZED,HARDFP,FASTMATH,NEON,HELIUM,UNROLL,ROUNDING,PLATFORM,CORE,COMPILER,VERSION\n")
  10. if (OPTIMIZED)
  11. list(APPEND output "1")
  12. else()
  13. list(APPEND output "0")
  14. endif()
  15. if (HARDFP)
  16. list(APPEND output ",1")
  17. else()
  18. list(APPEND output ",0")
  19. endif()
  20. if (FASTMATHCOMPUTATIONS)
  21. list(APPEND output ",1")
  22. else()
  23. list(APPEND output ",0")
  24. endif()
  25. if (NEON OR NEONEXPERIMENTAL)
  26. list(APPEND output ",1")
  27. else()
  28. list(APPEND output ",0")
  29. endif()
  30. if (HELIUM OR MVEI OR MVEF)
  31. list(APPEND output ",1")
  32. else()
  33. list(APPEND output ",0")
  34. endif()
  35. if (LOOPUNROLL)
  36. list(APPEND output ",1")
  37. else()
  38. list(APPEND output ",0")
  39. endif()
  40. if (ROUNDING)
  41. list(APPEND output ",1")
  42. else()
  43. list(APPEND output ",0")
  44. endif()
  45. list(APPEND output ",${PLATFORMID}")
  46. if (CONFIGID)
  47. # Specific config ID (like M55 with autovectorizer)
  48. list(APPEND output ",${CONFIGID},")
  49. else()
  50. # Core ID is used as config ID when not specified
  51. list(APPEND output ",${COREID},")
  52. endif()
  53. if (ARMAC6)
  54. list(APPEND output "AC6")
  55. elseif(GCC)
  56. list(APPEND output "GCC")
  57. endif()
  58. compilerVersion()
  59. list(APPEND output ",${COMPILERVERSION}")
  60. file(WRITE ${path} ${output})
  61. endfunction()
  62. option(BENCHMARK "Benchmarking compiled" OFF)
  63. option(EXTBENCH "Benchmarking with external traces" OFF)
  64. option(NN "NN Tests included" OFF)
  65. option(REFLIB "Use already built reference lib" OFF)
  66. option(EMBEDDED "Embedded Mode" ON)
  67. option(FLOAT16TESTS "Float16 tests" OFF)
  68. option(ALLTESTS "All tests including Float16 tests" OFF)
  69. option(MICROBENCH "Micro benchmarks" OFF)
  70. option(EXTERNAL "External benchmarks or tests" OFF)
  71. option(CACHEANALYSIS "Build with cache analysis mode enabled" OFF)
  72. option(DISTINCT "Different generated folder for benchmarking and tests" OFF)
  73. project(Testing)
  74. # Needed to find the config modules
  75. set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
  76. # Change behavior of configBoot for scatter file
  77. # We use the linker files from older test framework because bigger sections are needed.
  78. # We should migrate the linker files to this new framework.
  79. set(TESTFRAMEWORK ON)
  80. include(config)
  81. if ((NOT REFLIB) AND (NOT NOCMSIS))
  82. add_subdirectory(../Source bin_dsp)
  83. endif()
  84. if (NN)
  85. add_subdirectory(${ROOT}/CMSIS/NN/Source bin_nn)
  86. endif()
  87. add_library(TestingLib STATIC)
  88. add_library(FrameworkLib STATIC)
  89. if (DISABLEFLOAT16)
  90. target_compile_definitions(TestingLib PRIVATE DISABLEFLOAT16)
  91. target_compile_definitions(FrameworkLib PRIVATE DISABLEFLOAT16)
  92. endif()
  93. if (AUTOVECTORIZE)
  94. target_compile_definitions(TestingLib PRIVATE ARM_MATH_AUTOVECTORIZE)
  95. endif()
  96. if (CACHEANALYSIS)
  97. target_compile_definitions(FrameworkLib PRIVATE CACHEANALYSIS)
  98. endif()
  99. if (BENCHMARK)
  100. set(STANDARDBENCH ON)
  101. if (MICROBENCH)
  102. set (MICROSRC
  103. Source/Benchmarks/MicroBenchmarksF32.cpp
  104. Source/Benchmarks/MicroBenchmarksQ31.cpp
  105. Source/Benchmarks/MicroBenchmarksQ15.cpp
  106. Source/Benchmarks/MicroBenchmarksQ7.cpp
  107. )
  108. set(STANDARDBENCH OFF)
  109. endif()
  110. if (EXTERNAL)
  111. add_subdirectory(${EXTERNALDIR} bin_external)
  112. set(STANDARDBENCH OFF)
  113. endif()
  114. set (NNSRC
  115. Source/Benchmarks/FullyConnectedBench.cpp
  116. Source/Benchmarks/PoolingBench.cpp
  117. )
  118. if (STANDARDBENCH)
  119. set(TESTSRC
  120. Source/Benchmarks/BasicMathsBenchmarksF32.cpp
  121. Source/Benchmarks/BasicMathsBenchmarksQ31.cpp
  122. Source/Benchmarks/BasicMathsBenchmarksQ15.cpp
  123. Source/Benchmarks/BasicMathsBenchmarksQ7.cpp
  124. Source/Benchmarks/ComplexMathsBenchmarksF32.cpp
  125. Source/Benchmarks/ComplexMathsBenchmarksQ31.cpp
  126. Source/Benchmarks/ComplexMathsBenchmarksQ15.cpp
  127. Source/Benchmarks/QuaternionMathsBenchmarksF32.cpp
  128. Source/Benchmarks/BayesF32.cpp
  129. Source/Benchmarks/SVMF32.cpp
  130. Source/Benchmarks/DistanceF32.cpp
  131. Source/Benchmarks/DistanceU32.cpp
  132. Source/Benchmarks/StatsF64.cpp
  133. Source/Benchmarks/StatsF32.cpp
  134. Source/Benchmarks/StatsQ31.cpp
  135. Source/Benchmarks/StatsQ15.cpp
  136. Source/Benchmarks/StatsQ7.cpp
  137. Source/Benchmarks/FIRF32.cpp
  138. Source/Benchmarks/FIRQ31.cpp
  139. Source/Benchmarks/FIRQ15.cpp
  140. Source/Benchmarks/FIRQ7.cpp
  141. Source/Benchmarks/MISCF32.cpp
  142. Source/Benchmarks/MISCQ31.cpp
  143. Source/Benchmarks/MISCQ15.cpp
  144. Source/Benchmarks/MISCQ7.cpp
  145. Source/Benchmarks/DECIMF32.cpp
  146. Source/Benchmarks/DECIMQ31.cpp
  147. Source/Benchmarks/DECIMQ15.cpp
  148. Source/Benchmarks/BIQUADF32.cpp
  149. Source/Benchmarks/BIQUADF64.cpp
  150. Source/Benchmarks/ControllerF32.cpp
  151. Source/Benchmarks/ControllerQ31.cpp
  152. Source/Benchmarks/ControllerQ15.cpp
  153. Source/Benchmarks/FastMathF32.cpp
  154. Source/Benchmarks/FastMathQ31.cpp
  155. Source/Benchmarks/FastMathQ15.cpp
  156. Source/Benchmarks/SupportF32.cpp
  157. Source/Benchmarks/SupportBarF32.cpp
  158. Source/Benchmarks/SupportQ31.cpp
  159. Source/Benchmarks/SupportQ15.cpp
  160. Source/Benchmarks/SupportQ7.cpp
  161. Source/Benchmarks/UnaryF32.cpp
  162. Source/Benchmarks/UnaryF64.cpp
  163. Source/Benchmarks/UnaryQ31.cpp
  164. Source/Benchmarks/UnaryQ15.cpp
  165. Source/Benchmarks/UnaryQ7.cpp
  166. Source/Benchmarks/BinaryF32.cpp
  167. Source/Benchmarks/BinaryQ31.cpp
  168. Source/Benchmarks/BinaryQ15.cpp
  169. Source/Benchmarks/BinaryQ7.cpp
  170. Source/Benchmarks/TransformF32.cpp
  171. Source/Benchmarks/TransformQ31.cpp
  172. Source/Benchmarks/TransformQ15.cpp
  173. )
  174. target_include_directories(TestingLib PRIVATE Include/Benchmarks)
  175. endif()
  176. if ((NOT ARMAC5) AND (FLOAT16TESTS OR ALLTESTS) AND ((FLOAT16) OR (MVEF) OR (HELIUM) OR (NEON) OR (NEONEXPERIMENTAL)))
  177. set(TESTSRC16 Source/Benchmarks/BasicMathsBenchmarksF16.cpp
  178. Source/Benchmarks/ComplexMathsBenchmarksF16.cpp
  179. Source/Benchmarks/BayesF16.cpp
  180. Source/Benchmarks/SVMF16.cpp
  181. Source/Benchmarks/DistanceF16.cpp
  182. Source/Benchmarks/StatsF16.cpp
  183. Source/Benchmarks/FIRF16.cpp
  184. Source/Benchmarks/MISCF16.cpp
  185. Source/Benchmarks/BIQUADF16.cpp
  186. Source/Benchmarks/FastMathF16.cpp
  187. Source/Benchmarks/SupportF16.cpp
  188. Source/Benchmarks/SupportBarF16.cpp
  189. Source/Benchmarks/UnaryF16.cpp
  190. Source/Benchmarks/BinaryF16.cpp
  191. Source/Benchmarks/TransformF16.cpp
  192. )
  193. endif()
  194. else()
  195. set(STANDARDTEST ON)
  196. set(NNSRC
  197. Source/Tests/NNSupport.cpp
  198. Source/Tests/Pooling.cpp
  199. Source/Tests/Softmax.cpp
  200. Source/Tests/FullyConnected.cpp
  201. )
  202. if (EXTERNAL)
  203. add_subdirectory(${EXTERNALDIR} bin_external)
  204. set(STANDARDTEST OFF)
  205. endif()
  206. if (STANDARDTEST)
  207. if (BASICMATH)
  208. set(BASICMATHSRC Source/Tests/BasicTestsF64.cpp
  209. Source/Tests/BasicTestsF32.cpp
  210. Source/Tests/BasicTestsQ31.cpp
  211. Source/Tests/BasicTestsQ15.cpp
  212. Source/Tests/BasicTestsQ7.cpp)
  213. endif()
  214. if (QUATERNIONMATH)
  215. set(QUATERNIONMATHSRC Source/Tests/QuaternionTestsF32.cpp
  216. )
  217. endif()
  218. if (COMPLEXMATH)
  219. set(COMPLEXMATHSRC Source/Tests/ComplexTestsF64.cpp
  220. Source/Tests/ComplexTestsF32.cpp
  221. Source/Tests/ComplexTestsQ31.cpp
  222. Source/Tests/ComplexTestsQ15.cpp)
  223. endif()
  224. if (CONTROLLER)
  225. set(CONTROLLERSRC )
  226. endif()
  227. if (FASTMATH)
  228. set(FASTMATHSRC Source/Tests/FastMathF64.cpp
  229. Source/Tests/FastMathF32.cpp
  230. Source/Tests/FastMathQ31.cpp
  231. Source/Tests/FastMathQ15.cpp)
  232. endif()
  233. if (FILTERING)
  234. set(FILTERINGSRC Source/Tests/DECIMF32.cpp
  235. Source/Tests/DECIMQ31.cpp
  236. Source/Tests/DECIMQ15.cpp
  237. Source/Tests/MISCF64.cpp
  238. Source/Tests/MISCF32.cpp
  239. Source/Tests/MISCQ31.cpp
  240. Source/Tests/MISCQ15.cpp
  241. Source/Tests/MISCQ7.cpp
  242. Source/Tests/FIRF64.cpp
  243. Source/Tests/FIRF32.cpp
  244. Source/Tests/FIRQ31.cpp
  245. Source/Tests/FIRQ15.cpp
  246. Source/Tests/FIRQ7.cpp
  247. Source/Tests/BIQUADF64.cpp
  248. Source/Tests/BIQUADF32.cpp
  249. Source/Tests/BIQUADQ31.cpp
  250. Source/Tests/BIQUADQ15.cpp)
  251. endif()
  252. if (MATRIX)
  253. set(MATRIXSRC Source/Tests/UnaryTestsQ31.cpp
  254. Source/Tests/UnaryTestsQ15.cpp
  255. Source/Tests/UnaryTestsQ7.cpp
  256. Source/Tests/UnaryTestsF32.cpp
  257. Source/Tests/UnaryTestsF64.cpp
  258. Source/Tests/BinaryTestsF32.cpp
  259. Source/Tests/BinaryTestsF64.cpp
  260. Source/Tests/BinaryTestsQ31.cpp
  261. Source/Tests/BinaryTestsQ15.cpp
  262. Source/Tests/BinaryTestsQ7.cpp)
  263. endif()
  264. if (STATISTICS)
  265. set(STATISTICSSRC Source/Tests/StatsTestsF32.cpp
  266. Source/Tests/StatsTestsF64.cpp
  267. Source/Tests/StatsTestsQ31.cpp
  268. Source/Tests/StatsTestsQ15.cpp
  269. Source/Tests/StatsTestsQ7.cpp)
  270. endif()
  271. if (SUPPORT)
  272. set(SUPPORTSRC Source/Tests/SupportTestsF64.cpp
  273. Source/Tests/SupportTestsF32.cpp
  274. Source/Tests/SupportTestsQ31.cpp
  275. Source/Tests/SupportTestsQ15.cpp
  276. Source/Tests/SupportTestsQ7.cpp
  277. Source/Tests/SupportBarTestsF32.cpp)
  278. endif()
  279. if (TRANSFORM)
  280. set(TRANSFORMSRC Source/Tests/TransformCF64.cpp
  281. Source/Tests/TransformCF32.cpp
  282. Source/Tests/TransformRF64.cpp
  283. Source/Tests/TransformRF32.cpp
  284. Source/Tests/TransformCQ31.cpp
  285. Source/Tests/TransformRQ31.cpp
  286. Source/Tests/TransformCQ15.cpp
  287. Source/Tests/TransformRQ15.cpp
  288. Source/Tests/MFCCF32.cpp
  289. Source/Tests/MFCCQ31.cpp
  290. Source/Tests/MFCCQ15.cpp
  291. Source/Tests/mfccdata.c
  292. )
  293. endif()
  294. if (SVM)
  295. set(SVMSRC Source/Tests/SVMF32.cpp)
  296. endif()
  297. if (BAYES)
  298. set(BAYESSRC Source/Tests/BayesF32.cpp)
  299. endif()
  300. if (DISTANCE)
  301. set(DISTANCESRC Source/Tests/DistanceTestsF64.cpp
  302. Source/Tests/DistanceTestsF32.cpp
  303. Source/Tests/DistanceTestsU32.cpp)
  304. endif()
  305. if (INTERPOLATION)
  306. set(INTERPOLATIONSRC Source/Tests/InterpolationTestsF32.cpp
  307. Source/Tests/InterpolationTestsQ31.cpp
  308. Source/Tests/InterpolationTestsQ15.cpp
  309. Source/Tests/InterpolationTestsQ7.cpp)
  310. endif()
  311. set(TESTSRC
  312. ${BASICMATHSRC}
  313. ${COMPLEXMATHSRC}
  314. ${CONTROLLERSRC}
  315. ${FASTMATHSRC}
  316. ${FILTERINGSRC}
  317. ${MATRIXSRC}
  318. ${STATISTICSSRC}
  319. ${SUPPORTSRC}
  320. ${TRANSFORMSRC}
  321. ${SVMSRC}
  322. ${BAYESSRC}
  323. ${DISTANCESRC}
  324. ${QUATERNIONMATHSRC}
  325. ${INTERPOLATIONSRC}
  326. #Source/Tests/ExampleCategoryF32.cpp
  327. #Source/Tests/ExampleCategoryQ31.cpp
  328. #Source/Tests/ExampleCategoryQ15.cpp
  329. #Source/Tests/ExampleCategoryQ7.cpp
  330. )
  331. if ((NOT ARMAC5) AND (FLOAT16TESTS OR ALLTESTS) AND ((FLOAT16) OR (MVEF) OR (HELIUM) OR (NEON) OR (NEONEXPERIMENTAL)))
  332. set(TESTSRC16
  333. Source/Tests/BasicTestsF16.cpp
  334. Source/Tests/ComplexTestsF16.cpp
  335. Source/Tests/InterpolationTestsF16.cpp
  336. Source/Tests/StatsTestsF16.cpp
  337. Source/Tests/FIRF16.cpp
  338. Source/Tests/BIQUADF16.cpp
  339. Source/Tests/MISCF16.cpp
  340. Source/Tests/BinaryTestsF16.cpp
  341. Source/Tests/UnaryTestsF16.cpp
  342. Source/Tests/TransformCF16.cpp
  343. Source/Tests/TransformRF16.cpp
  344. Source/Tests/SupportTestsF16.cpp
  345. Source/Tests/SupportBarTestsF16.cpp
  346. Source/Tests/FastMathF16.cpp
  347. Source/Tests/DistanceTestsF16.cpp
  348. Source/Tests/SVMF16.cpp
  349. Source/Tests/BayesF16.cpp
  350. Source/Tests/MFCCF16.cpp
  351. Source/Tests/mfccdata_f16.c
  352. )
  353. endif()
  354. endif()
  355. target_include_directories(TestingLib PUBLIC Include/Tests)
  356. endif()
  357. set(FRAMEWORKSRC
  358. FrameworkSource/Test.cpp
  359. FrameworkSource/IORunner.cpp
  360. FrameworkSource/ArrayMemory.cpp
  361. FrameworkSource/Pattern.cpp
  362. FrameworkSource/PatternMgr.cpp
  363. FrameworkSource/Error.cpp
  364. FrameworkSource/Timing.cpp
  365. FrameworkSource/Generators.cpp
  366. FrameworkSource/Calibrate.cpp
  367. )
  368. if (EMBEDDED)
  369. set(FRAMEWORKMODESRC FrameworkSource/FPGA.cpp)
  370. else()
  371. set(FRAMEWORKMODESRC FrameworkSource/Semihosting.cpp)
  372. endif()
  373. # With -O2, generated code is crashing on some cycle accurate models.
  374. # (cpp part)
  375. disableOptimization(TestingLib)
  376. disableOptimization(FrameworkLib)
  377. ## Only build f16 version when running float16tests or all tests
  378. ## and float16 are supported
  379. if (ARMAC5)
  380. target_sources(TestingLib PRIVATE ${TESTSRC})
  381. elseif ((FLOAT16) OR (MVEF) OR (HELIUM) OR (NEON) OR (NEONEXPERIMENTAL))
  382. if (ALLTESTS)
  383. target_sources(TestingLib PRIVATE ${TESTSRC16})
  384. target_sources(TestingLib PRIVATE ${TESTSRC})
  385. elseif (FLOAT16TESTS)
  386. target_sources(TestingLib PRIVATE ${TESTSRC16})
  387. else()
  388. target_sources(TestingLib PRIVATE ${TESTSRC})
  389. endif()
  390. else()
  391. target_sources(TestingLib PRIVATE ${TESTSRC})
  392. endif()
  393. if(NN)
  394. target_sources(TestingLib PRIVATE ${NNSRC})
  395. endif()
  396. target_sources(TestingLib PRIVATE testmain.cpp)
  397. if ((DISTINCT) AND (BENCHMARK))
  398. target_sources(TestingLib PRIVATE GeneratedSourceBench/TestDesc.cpp)
  399. else()
  400. target_sources(TestingLib PRIVATE GeneratedSource/TestDesc.cpp)
  401. endif()
  402. if (EMBEDDED)
  403. target_compile_definitions(TestingLib PUBLIC EMBEDDED)
  404. endif()
  405. if (BENCHMARK)
  406. target_compile_definitions(TestingLib PUBLIC BENCHMARK)
  407. if (MICROBENCH)
  408. target_sources(TestingLib PRIVATE ${MICROSRC})
  409. endif()
  410. endif()
  411. target_sources(FrameworkLib PRIVATE ${FRAMEWORKSRC})
  412. target_sources(FrameworkLib PRIVATE ${FRAMEWORKMODESRC})
  413. target_compile_definitions(FrameworkLib PRIVATE ${PLATFORMOPT})
  414. if (DISABLEFLOAT16)
  415. target_compile_definitions(FrameworkLib PRIVATE DISABLEFLOAT16)
  416. endif()
  417. if (BENCHMARK)
  418. target_compile_definitions(FrameworkLib PUBLIC BENCHMARK)
  419. endif()
  420. if (EXTBENCH)
  421. target_compile_definitions(FrameworkLib PUBLIC EXTBENCH)
  422. endif()
  423. ### Includes
  424. if (REFLIB)
  425. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../Source)
  426. include(configDsp)
  427. SET(DSP ${ROOT}/CMSIS/DSP)
  428. target_include_directories(TestingLib PUBLIC "${DSP}/Include")
  429. target_link_libraries(TestingLib PRIVATE "${REFLIBNAME}")
  430. else()
  431. if (NOT NOCMSIS)
  432. target_link_libraries(TestingLib PRIVATE CMSISDSP)
  433. endif()
  434. endif()
  435. if(NN)
  436. target_link_libraries(TestingLib PRIVATE CMSISNN)
  437. endif()
  438. target_include_directories(TestingLib PRIVATE FrameworkInclude)
  439. if ((DISTINCT) AND (BENCHMARK))
  440. target_include_directories(TestingLib PRIVATE GeneratedIncludeBench)
  441. else()
  442. target_include_directories(TestingLib PRIVATE GeneratedInclude)
  443. endif()
  444. configLib(TestingLib ${ROOT})
  445. #configDsp(TestingLib ${ROOT})
  446. configLib(FrameworkLib ${ROOT})
  447. target_include_directories(FrameworkLib PRIVATE FrameworkInclude)
  448. # arm_math.h is needed for q7,q15,q31 types
  449. # which are used for access to pattern files.
  450. target_include_directories(FrameworkLib PRIVATE ${ROOT}/CMSIS/DSP/Include)
  451. # Because we need access to core include for
  452. # timing features in the test framework.
  453. # So we need to identify the core
  454. # then reference the right include folder
  455. set_platform_core()
  456. core_includes(FrameworkLib)
  457. add_executable(Testing main.cpp)
  458. # To see the file in the scatter load, it must not because
  459. # linked in a .a archive
  460. if ((DISTINCT) AND (BENCHMARK))
  461. target_include_directories(Testing PRIVATE GeneratedIncludeBench)
  462. else()
  463. target_include_directories(Testing PRIVATE GeneratedInclude)
  464. endif()
  465. target_sources(Testing PRIVATE patterndata.c)
  466. # With -O2, generated code is crashing on some cycle accurate models.
  467. # (cpp part)
  468. disableOptimization(Testing)
  469. configApp(Testing ${ROOT})
  470. target_link_libraries(Testing PRIVATE TestingLib)
  471. target_link_libraries(Testing PRIVATE FrameworkLib)
  472. if (EXTERNAL)
  473. target_include_directories(${EXTERNALPROJECT} PRIVATE FrameworkInclude)
  474. if ((DISTINCT) AND (BENCHMARK))
  475. target_include_directories(${EXTERNALPROJECT} PRIVATE GeneratedIncludeBench)
  476. else()
  477. target_include_directories(${EXTERNALPROJECT} PRIVATE GeneratedInclude)
  478. endif()
  479. target_link_libraries(TestingLib PRIVATE ${EXTERNALPROJECT})
  480. endif()
  481. writeConfig(${CMAKE_CURRENT_BINARY_DIR}/currentConfig.csv)
  482. find_package(Doxygen)
  483. if(DOXYGEN_FOUND)
  484. # exclude sqlite code
  485. set(DOXYGEN_EXCLUDE_PATTERNS
  486. */sqlite3/*
  487. )
  488. # doxygen settings can be set here, prefixed with "DOXYGEN_"
  489. set(DOXYGEN_SOURCE_BROWSER NO)
  490. set(DOXYGEN_EXTRACT_ALL YES)
  491. set(DOXYGEN_EXTRACT_PRIVATE NO)
  492. set(DOXYGEN_GENERATE_XML NO)
  493. set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
  494. set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
  495. set(DOXYGEN_TYPEDEF_HIDES_STRUCT YES)
  496. set(DOXYGEN_ENABLE_PREPROCESSING YES)
  497. set(DOXYGEN_MACRO_EXPANSION YES)
  498. set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
  499. set(DOXYGEN_MARKDOWN_SUPPORT YES)
  500. set(DOXYGEN_AUTOLINK_SUPPORT YES)
  501. set(DOXYGEN_QUIET YES)
  502. set(DOXYGEN_SHOW_USED_FILES NO)
  503. set(DOXYGENEXTRACT_LOCAL_CLASSES NO)
  504. set(DOXYGENSHOW_INCLUDE_FILES NO)
  505. set(DOXYGEN_TYPEDEF_HIDES_STRUCT YES)
  506. set(DOXYGEN_FULL_PATH_NAMES NO)
  507. set(DOXYGEN_RECURSIVE YES)
  508. set(DOXYGEN_REFERENCES_LINK_SOURCE NO)
  509. set(DOXYGEN_EXCLUDE_PATTERNS "*/RTE/*")
  510. set(DOXYGEN_PREDEFINED "__ARM_FP16_FORMAT_IEEE=1;ARM_FLOAT16_SUPPORTED=1;__ALIGNED(x)=")
  511. set(DOXYGEN_EXAMPLE_PATH "${ROOT}/CMSIS/DSP/Examples/ARM")
  512. set(DOXYGEN_IMAGE_PATH "${ROOT}/CMSIS/DoxyGen/DSP/src/images")
  513. set(DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/docs")
  514. set(DOXYGEN_LAYOUT_FILE "${ROOT}/CMSIS/DoxyGen/Doxygen_Templates/DoxygenLayout_forUser.xml")
  515. # this target will only be built if specifically asked to.
  516. # run "make api-docs" to create the doxygen documentation
  517. doxygen_add_docs(
  518. docs
  519. ${ROOT}/CMSIS/DSP/Source
  520. ${ROOT}/CMSIS/DSP/Examples/ARM
  521. ${ROOT}/CMSIS/DSP/Include
  522. ${ROOT}/CMSIS/DoxyGen/DSP/src/history.txt
  523. COMMENT "Generate API-documents"
  524. )
  525. endif(DOXYGEN_FOUND)