CMakeLists.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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/BasicTestsF32.cpp
  209. Source/Tests/BasicTestsQ31.cpp
  210. Source/Tests/BasicTestsQ15.cpp
  211. Source/Tests/BasicTestsQ7.cpp)
  212. endif()
  213. if (QUATERNIONMATH)
  214. set(QUATERNIONMATHSRC Source/Tests/QuaternionTestsF32.cpp
  215. )
  216. endif()
  217. if (COMPLEXMATH)
  218. set(COMPLEXMATHSRC Source/Tests/ComplexTestsF32.cpp
  219. Source/Tests/ComplexTestsQ31.cpp
  220. Source/Tests/ComplexTestsQ15.cpp)
  221. endif()
  222. if (CONTROLLER)
  223. set(CONTROLLERSRC )
  224. endif()
  225. if (FASTMATH)
  226. set(FASTMATHSRC Source/Tests/FastMathF32.cpp
  227. Source/Tests/FastMathQ31.cpp
  228. Source/Tests/FastMathQ15.cpp)
  229. endif()
  230. if (FILTERING)
  231. set(FILTERINGSRC Source/Tests/DECIMF32.cpp
  232. Source/Tests/DECIMQ31.cpp
  233. Source/Tests/DECIMQ15.cpp
  234. Source/Tests/MISCF32.cpp
  235. Source/Tests/MISCQ31.cpp
  236. Source/Tests/MISCQ15.cpp
  237. Source/Tests/MISCQ7.cpp
  238. Source/Tests/FIRF32.cpp
  239. Source/Tests/FIRQ31.cpp
  240. Source/Tests/FIRQ15.cpp
  241. Source/Tests/FIRQ7.cpp
  242. Source/Tests/BIQUADF64.cpp
  243. Source/Tests/BIQUADF32.cpp
  244. Source/Tests/BIQUADQ31.cpp
  245. Source/Tests/BIQUADQ15.cpp)
  246. endif()
  247. if (MATRIX)
  248. set(MATRIXSRC Source/Tests/UnaryTestsQ31.cpp
  249. Source/Tests/UnaryTestsQ15.cpp
  250. Source/Tests/UnaryTestsQ7.cpp
  251. Source/Tests/UnaryTestsF32.cpp
  252. Source/Tests/UnaryTestsF64.cpp
  253. Source/Tests/BinaryTestsF32.cpp
  254. Source/Tests/BinaryTestsF64.cpp
  255. Source/Tests/BinaryTestsQ31.cpp
  256. Source/Tests/BinaryTestsQ15.cpp
  257. Source/Tests/BinaryTestsQ7.cpp)
  258. endif()
  259. if (STATISTICS)
  260. set(STATISTICSSRC Source/Tests/StatsTestsF32.cpp
  261. Source/Tests/StatsTestsF64.cpp
  262. Source/Tests/StatsTestsQ31.cpp
  263. Source/Tests/StatsTestsQ15.cpp
  264. Source/Tests/StatsTestsQ7.cpp)
  265. endif()
  266. if (SUPPORT)
  267. set(SUPPORTSRC Source/Tests/SupportTestsF32.cpp
  268. Source/Tests/SupportTestsQ31.cpp
  269. Source/Tests/SupportTestsQ15.cpp
  270. Source/Tests/SupportTestsQ7.cpp
  271. Source/Tests/SupportBarTestsF32.cpp)
  272. endif()
  273. if (TRANSFORM)
  274. set(TRANSFORMSRC Source/Tests/TransformCF64.cpp
  275. Source/Tests/TransformCF32.cpp
  276. Source/Tests/TransformRF64.cpp
  277. Source/Tests/TransformRF32.cpp
  278. Source/Tests/TransformCQ31.cpp
  279. Source/Tests/TransformRQ31.cpp
  280. Source/Tests/TransformCQ15.cpp
  281. Source/Tests/TransformRQ15.cpp)
  282. endif()
  283. if (SVM)
  284. set(SVMSRC Source/Tests/SVMF32.cpp)
  285. endif()
  286. if (BAYES)
  287. set(BAYESSRC Source/Tests/BayesF32.cpp)
  288. endif()
  289. if (DISTANCE)
  290. set(DISTANCESRC Source/Tests/DistanceTestsF32.cpp
  291. Source/Tests/DistanceTestsU32.cpp)
  292. endif()
  293. if (INTERPOLATION)
  294. set(INTERPOLATIONSRC Source/Tests/InterpolationTestsF32.cpp
  295. Source/Tests/InterpolationTestsQ31.cpp
  296. Source/Tests/InterpolationTestsQ15.cpp
  297. Source/Tests/InterpolationTestsQ7.cpp)
  298. endif()
  299. set(TESTSRC
  300. ${BASICMATHSRC}
  301. ${COMPLEXMATHSRC}
  302. ${CONTROLLERSRC}
  303. ${FASTMATHSRC}
  304. ${FILTERINGSRC}
  305. ${MATRIXSRC}
  306. ${STATISTICSSRC}
  307. ${SUPPORTSRC}
  308. ${TRANSFORMSRC}
  309. ${SVMSRC}
  310. ${BAYESSRC}
  311. ${DISTANCESRC}
  312. ${QUATERNIONMATHSRC}
  313. ${INTERPOLATIONSRC}
  314. #Source/Tests/ExampleCategoryF32.cpp
  315. #Source/Tests/ExampleCategoryQ31.cpp
  316. #Source/Tests/ExampleCategoryQ15.cpp
  317. #Source/Tests/ExampleCategoryQ7.cpp
  318. )
  319. if ((NOT ARMAC5) AND (FLOAT16TESTS OR ALLTESTS) AND ((FLOAT16) OR (MVEF) OR (HELIUM) OR (NEON) OR (NEONEXPERIMENTAL)))
  320. set(TESTSRC16
  321. Source/Tests/BasicTestsF16.cpp
  322. Source/Tests/ComplexTestsF16.cpp
  323. Source/Tests/InterpolationTestsF16.cpp
  324. Source/Tests/StatsTestsF16.cpp
  325. Source/Tests/FIRF16.cpp
  326. Source/Tests/BIQUADF16.cpp
  327. Source/Tests/MISCF16.cpp
  328. Source/Tests/BinaryTestsF16.cpp
  329. Source/Tests/UnaryTestsF16.cpp
  330. Source/Tests/TransformCF16.cpp
  331. Source/Tests/TransformRF16.cpp
  332. Source/Tests/SupportTestsF16.cpp
  333. Source/Tests/SupportBarTestsF16.cpp
  334. Source/Tests/FastMathF16.cpp
  335. Source/Tests/DistanceTestsF16.cpp
  336. Source/Tests/SVMF16.cpp
  337. Source/Tests/BayesF16.cpp
  338. )
  339. endif()
  340. endif()
  341. target_include_directories(TestingLib PUBLIC Include/Tests)
  342. endif()
  343. set(FRAMEWORKSRC
  344. FrameworkSource/Test.cpp
  345. FrameworkSource/IORunner.cpp
  346. FrameworkSource/ArrayMemory.cpp
  347. FrameworkSource/Pattern.cpp
  348. FrameworkSource/PatternMgr.cpp
  349. FrameworkSource/Error.cpp
  350. FrameworkSource/Timing.cpp
  351. FrameworkSource/Generators.cpp
  352. FrameworkSource/Calibrate.cpp
  353. )
  354. if (EMBEDDED)
  355. set(FRAMEWORKMODESRC FrameworkSource/FPGA.cpp)
  356. else()
  357. set(FRAMEWORKMODESRC FrameworkSource/Semihosting.cpp)
  358. endif()
  359. # With -O2, generated code is crashing on some cycle accurate models.
  360. # (cpp part)
  361. disableOptimization(TestingLib)
  362. disableOptimization(FrameworkLib)
  363. ## Only build f16 version when running float16tests or all tests
  364. ## and float16 are supported
  365. if (ARMAC5)
  366. target_sources(TestingLib PRIVATE ${TESTSRC})
  367. elseif ((FLOAT16) OR (MVEF) OR (HELIUM) OR (NEON) OR (NEONEXPERIMENTAL))
  368. if (ALLTESTS)
  369. target_sources(TestingLib PRIVATE ${TESTSRC16})
  370. target_sources(TestingLib PRIVATE ${TESTSRC})
  371. elseif (FLOAT16TESTS)
  372. target_sources(TestingLib PRIVATE ${TESTSRC16})
  373. else()
  374. target_sources(TestingLib PRIVATE ${TESTSRC})
  375. endif()
  376. else()
  377. target_sources(TestingLib PRIVATE ${TESTSRC})
  378. endif()
  379. if(NN)
  380. target_sources(TestingLib PRIVATE ${NNSRC})
  381. endif()
  382. target_sources(TestingLib PRIVATE testmain.cpp)
  383. if ((DISTINCT) AND (BENCHMARK))
  384. target_sources(TestingLib PRIVATE GeneratedSourceBench/TestDesc.cpp)
  385. else()
  386. target_sources(TestingLib PRIVATE GeneratedSource/TestDesc.cpp)
  387. endif()
  388. if (EMBEDDED)
  389. target_compile_definitions(TestingLib PUBLIC EMBEDDED)
  390. endif()
  391. if (BENCHMARK)
  392. target_compile_definitions(TestingLib PUBLIC BENCHMARK)
  393. if (MICROBENCH)
  394. target_sources(TestingLib PRIVATE ${MICROSRC})
  395. endif()
  396. endif()
  397. target_sources(FrameworkLib PRIVATE ${FRAMEWORKSRC})
  398. target_sources(FrameworkLib PRIVATE ${FRAMEWORKMODESRC})
  399. target_compile_definitions(FrameworkLib PRIVATE ${PLATFORMOPT})
  400. if (DISABLEFLOAT16)
  401. target_compile_definitions(FrameworkLib PRIVATE DISABLEFLOAT16)
  402. endif()
  403. if (BENCHMARK)
  404. target_compile_definitions(FrameworkLib PUBLIC BENCHMARK)
  405. endif()
  406. if (EXTBENCH)
  407. target_compile_definitions(FrameworkLib PUBLIC EXTBENCH)
  408. endif()
  409. ### Includes
  410. if (REFLIB)
  411. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../Source)
  412. include(configDsp)
  413. SET(DSP ${ROOT}/CMSIS/DSP)
  414. target_include_directories(TestingLib PUBLIC "${DSP}/Include")
  415. target_link_libraries(TestingLib PRIVATE "${REFLIBNAME}")
  416. else()
  417. if (NOT NOCMSIS)
  418. target_link_libraries(TestingLib PRIVATE CMSISDSP)
  419. endif()
  420. endif()
  421. if(NN)
  422. target_link_libraries(TestingLib PRIVATE CMSISNN)
  423. endif()
  424. target_include_directories(TestingLib PRIVATE FrameworkInclude)
  425. if ((DISTINCT) AND (BENCHMARK))
  426. target_include_directories(TestingLib PRIVATE GeneratedIncludeBench)
  427. else()
  428. target_include_directories(TestingLib PRIVATE GeneratedInclude)
  429. endif()
  430. configLib(TestingLib ${ROOT})
  431. #configDsp(TestingLib ${ROOT})
  432. configLib(FrameworkLib ${ROOT})
  433. target_include_directories(FrameworkLib PRIVATE FrameworkInclude)
  434. # arm_math.h is needed for q7,q15,q31 types
  435. # which are used for access to pattern files.
  436. target_include_directories(FrameworkLib PRIVATE ${ROOT}/CMSIS/DSP/Include)
  437. # Because we need access to core include for
  438. # timing features in the test framework.
  439. # So we need to identify the core
  440. # then reference the right include folder
  441. set_platform_core()
  442. core_includes(FrameworkLib)
  443. add_executable(Testing main.cpp)
  444. # To see the file in the scatter load, it must not because
  445. # linked in a .a archive
  446. if ((DISTINCT) AND (BENCHMARK))
  447. target_include_directories(Testing PRIVATE GeneratedIncludeBench)
  448. else()
  449. target_include_directories(Testing PRIVATE GeneratedInclude)
  450. endif()
  451. target_sources(Testing PRIVATE patterndata.c)
  452. # With -O2, generated code is crashing on some cycle accurate models.
  453. # (cpp part)
  454. disableOptimization(Testing)
  455. configApp(Testing ${ROOT})
  456. target_link_libraries(Testing PRIVATE TestingLib)
  457. target_link_libraries(Testing PRIVATE FrameworkLib)
  458. if (EXTERNAL)
  459. target_include_directories(${EXTERNALPROJECT} PRIVATE FrameworkInclude)
  460. if ((DISTINCT) AND (BENCHMARK))
  461. target_include_directories(${EXTERNALPROJECT} PRIVATE GeneratedIncludeBench)
  462. else()
  463. target_include_directories(${EXTERNALPROJECT} PRIVATE GeneratedInclude)
  464. endif()
  465. target_link_libraries(TestingLib PRIVATE ${EXTERNALPROJECT})
  466. endif()
  467. writeConfig(${CMAKE_CURRENT_BINARY_DIR}/currentConfig.csv)
  468. find_package(Doxygen)
  469. if(DOXYGEN_FOUND)
  470. # exclude sqlite code
  471. set(DOXYGEN_EXCLUDE_PATTERNS
  472. */sqlite3/*
  473. )
  474. # doxygen settings can be set here, prefixed with "DOXYGEN_"
  475. set(DOXYGEN_SOURCE_BROWSER NO)
  476. set(DOXYGEN_EXTRACT_ALL YES)
  477. set(DOXYGEN_EXTRACT_PRIVATE NO)
  478. set(DOXYGEN_GENERATE_XML NO)
  479. set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
  480. set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
  481. set(DOXYGEN_TYPEDEF_HIDES_STRUCT YES)
  482. set(DOXYGEN_ENABLE_PREPROCESSING YES)
  483. set(DOXYGEN_MACRO_EXPANSION YES)
  484. set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
  485. set(DOXYGEN_MARKDOWN_SUPPORT YES)
  486. set(DOXYGEN_AUTOLINK_SUPPORT YES)
  487. set(DOXYGEN_QUIET YES)
  488. set(DOXYGEN_SHOW_USED_FILES NO)
  489. set(DOXYGENEXTRACT_LOCAL_CLASSES NO)
  490. set(DOXYGENSHOW_INCLUDE_FILES NO)
  491. set(DOXYGEN_TYPEDEF_HIDES_STRUCT YES)
  492. set(DOXYGEN_FULL_PATH_NAMES NO)
  493. set(DOXYGEN_RECURSIVE YES)
  494. set(DOXYGEN_REFERENCES_LINK_SOURCE NO)
  495. set(DOXYGEN_EXCLUDE_PATTERNS "*/RTE/*")
  496. set(DOXYGEN_PREDEFINED "__ARM_FP16_FORMAT_IEEE=1;ARM_FLOAT16_SUPPORTED=1;__ALIGNED(x)=")
  497. set(DOXYGEN_EXAMPLE_PATH "${ROOT}/CMSIS/DSP/Examples/ARM")
  498. set(DOXYGEN_IMAGE_PATH "${ROOT}/CMSIS/DoxyGen/DSP/src/images")
  499. set(DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/docs")
  500. set(DOXYGEN_LAYOUT_FILE "${ROOT}/CMSIS/DoxyGen/Doxygen_Templates/DoxygenLayout_forUser.xml")
  501. # this target will only be built if specifically asked to.
  502. # run "make api-docs" to create the doxygen documentation
  503. doxygen_add_docs(
  504. docs
  505. ${ROOT}/CMSIS/DSP/Source
  506. ${ROOT}/CMSIS/DSP/Examples/ARM
  507. ${ROOT}/CMSIS/DSP/Include
  508. ${ROOT}/CMSIS/DoxyGen/DSP/src/history.txt
  509. COMMENT "Generate API-documents"
  510. )
  511. endif(DOXYGEN_FOUND)