CMakeLists.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. # Copyright (C) 2020 QUECTEL Technologies Limited and/or its affiliates("QUECTEL").
  2. # All rights reserved.
  3. #
  4. configure_file (
  5. "${ql_app_dir}/ql_app_feature_config.h.in"
  6. "${out_inc_dir}/ql_app_feature_config.h"
  7. )
  8. if(NOT QL_PROJECT_MIXER AND NOT CONFIG_QUEC_PROJECT_FEATURE_VSIM_ADAPT_STD)
  9. #APPIMG2
  10. if(QL_APP_FEATURE_APPIMG2)
  11. if (QL_APP_PACK_FILE)
  12. if (QL_CCSDK_BUILD)
  13. set(CONFIG_PACKAGE_FILE_APPIMG2_JSON_PATH ${QL_APP_PACK_FILE_JSON_PATH}) #Path to the preset file of APPIMG2
  14. else()
  15. set(CONFIG_PACKAGE_FILE_APPIMG2_JSON_PATH $ENV{prepack_json_path})
  16. endif()
  17. endif()
  18. #In this case, the code for APPIMG and APPIMG2 is the same.Customers can modify as required.
  19. set(target ${QL_APP2_BUILD_VER})
  20. if(CONFIG_APPIMG_LOAD_FLASH)
  21. add_appimg2_flash_ql_example(${target} ql_appimg2_init.c) #The c file where the appimg2 entry function resides,you can specify.
  22. endif()
  23. if(CONFIG_APPIMG_LOAD_FILE)
  24. add_appimg2_file_ql_example(${target} ql_appimg2_init.c)
  25. endif()
  26. target_link_libraries(${target} PRIVATE ql_app_nw ql_app_peripheral ql_app_osi ql_app_dev ql_app_sim ql_app_power apploader)
  27. if(QL_APP_FEATURE_USB)
  28. target_link_libraries(${target} PRIVATE ql_app_usb)
  29. endif()
  30. if(QL_APP_FEATURE_FILE_ZIP)
  31. target_link_libraries(${target} PRIVATE ql_app_zip)
  32. endif()
  33. if(QL_APP_FEATURE_FTP)
  34. target_link_libraries(${target} PRIVATE ql_app_ftp)
  35. endif()
  36. if(QL_APP_FEATURE_HTTP)
  37. target_link_libraries(${target} PRIVATE ql_app_http)
  38. endif()
  39. if(QL_APP_FEATURE_MMS)
  40. target_link_libraries(${target} PRIVATE ql_app_mms)
  41. endif()
  42. if(QL_APP_FEATURE_MQTT)
  43. target_link_libraries(${target} PRIVATE ql_app_mqtt)
  44. endif()
  45. if(QL_APP_FEATURE_SSL)
  46. target_link_libraries(${target} PRIVATE ql_app_ssl)
  47. endif()
  48. if(QL_APP_FEATURE_PING)
  49. target_link_libraries(${target} PRIVATE ql_app_ping)
  50. endif()
  51. if(QL_APP_FEATURE_NTP)
  52. target_link_libraries(${target} PRIVATE ql_app_ntp)
  53. endif()
  54. if(QL_APP_FEATURE_FIREWALL)
  55. target_link_libraries(${target} PRIVATE ql_app_firewall)
  56. endif()
  57. if(QL_APP_FEATURE_LBS)
  58. target_link_libraries(${target} PRIVATE ql_app_lbs)
  59. endif()
  60. if(QL_APP_FEATURE_QTHSDK)
  61. target_link_libraries(${target} PRIVATE ql_app_qthsdk)
  62. endif()
  63. if(QL_APP_FEATURE_CTSREG)
  64. target_link_libraries(${target} PRIVATE ql_app_ctsreg)
  65. endif()
  66. if(QL_APP_FEATURE_SOCKET)
  67. target_link_libraries(${target} PRIVATE ql_app_socket)
  68. endif()
  69. if(QL_APP_FEATURE_AUDIO)
  70. target_link_libraries(${target} PRIVATE ql_app_audio)
  71. if(QL_APP_FEATURE_TTS)
  72. if(NOT CONFIG_QUEC_PROJECT_FEATURE_TTS_IN_KERNEL)
  73. add_library(ql_tts_api2 STATIC IMPORTED)
  74. set_target_properties(ql_tts_api2 PROPERTIES IMPORTED_LOCATION ${SOURCE_TOP_DIR}/components/newlib/armca5/libql_api_tts.a)
  75. target_link_libraries(${target} PRIVATE ql_app_tts ql_tts_api2 ${libm_file_name})
  76. else()
  77. target_link_libraries(${target} PRIVATE ql_app_tts ${libm_file_name})
  78. endif()
  79. endif()
  80. endif()
  81. if(QL_APP_FEATURE_WIFISCAN)
  82. target_link_libraries(${target} PRIVATE ql_app_wifi_scan)
  83. endif()
  84. if(QL_APP_FEATURE_BT)
  85. target_link_libraries(${target} PRIVATE ql_app_bt)
  86. endif()
  87. if(QL_APP_FEATURE_BT_HFP)
  88. target_link_libraries(${target} PRIVATE ql_app_bt_hfp)
  89. endif()
  90. if(QL_APP_FEATURE_BT_SPP)
  91. target_link_libraries(${target} PRIVATE ql_app_bt_spp)
  92. endif()
  93. if(QL_APP_FEATURE_BT_A2DP_AVRCP)
  94. target_link_libraries(${target} PRIVATE ql_app_bt_a2dp_avrcp)
  95. endif()
  96. if(QL_APP_FEATURE_BLE_GATT)
  97. target_link_libraries(${target} PRIVATE ql_app_ble_gatt)
  98. endif()
  99. if(QL_APP_FEATURE_GNSS)
  100. target_link_libraries(${target} PRIVATE ql_app_gnss)
  101. endif()
  102. if(QL_APP_FEATURE_HD_GNSS)
  103. target_link_libraries(${target} PRIVATE ql_app_hd_gnss)
  104. endif()
  105. if(QL_APP_FEATURE_LCD)
  106. target_link_libraries(${target} PRIVATE ql_app_lcd)
  107. endif()
  108. if(QL_APP_FEATURE_LVGL)
  109. target_link_libraries(${target} PRIVATE ql_app_lvgl)
  110. endif()
  111. if(QL_APP_FEATURE_CAMERA)
  112. target_link_libraries(${target} PRIVATE ql_app_camera)
  113. endif()
  114. if(QL_APP_FEATURE_FILE)
  115. target_link_libraries(${target} PRIVATE ql_app_file)
  116. endif()
  117. if(QL_APP_FEATURE_SMS)
  118. target_link_libraries(${target} PRIVATE ql_app_sms)
  119. endif()
  120. if(QL_APP_FEATURE_VOICE_CALL)
  121. target_link_libraries(${target} PRIVATE ql_app_voice_call)
  122. endif()
  123. if(QL_APP_FEATURE_VOLTE)
  124. target_link_libraries(${target} PRIVATE ql_app_volte)
  125. endif()
  126. if(QL_APP_FEATURE_STK)
  127. target_link_libraries(${target} PRIVATE ql_app_stk)
  128. endif()
  129. if(QL_APP_FEATURE_VSIM_ADAPT)
  130. target_link_libraries(${target} PRIVATE ql_app_vsim_adapt)
  131. endif()
  132. if(QL_APP_FEATURE_SPI)
  133. target_link_libraries(${target} PRIVATE ql_app_spi)
  134. endif()
  135. if(QL_APP_FEATURE_SPI_NOR_FLASH)
  136. target_link_libraries(${target} PRIVATE ql_app_spi_nor_flash)
  137. endif()
  138. if(QL_APP_FEATURE_SPI4_EXT_NOR_SFFS)
  139. target_link_libraries(${target} PRIVATE ql_app_spi4_ext_nor_sffs)
  140. endif()
  141. if(QL_APP_FEATURE_SPI6_EXT_NOR)
  142. target_link_libraries(${target} PRIVATE ql_app_spi6_ext_nor_flash)
  143. endif()
  144. if(QL_APP_FEATURE_SPI_NAND_FLASH)
  145. target_link_libraries(${target} PRIVATE ql_app_spi_nand_flash)
  146. endif()
  147. if(QL_APP_FEATURE_DECODER)
  148. add_library(ql_decoder_api2 STATIC IMPORTED)
  149. set_target_properties(ql_decoder_api2 PROPERTIES IMPORTED_LOCATION ${SOURCE_TOP_DIR}/components/newlib/armca5/libql_api_decoder.a)
  150. target_link_libraries(${target} PRIVATE ql_app_decoder ql_decoder_api2 ${libm_file_name})
  151. endif()
  152. if(QL_APP_FEATURE_APP_IMG_AT)
  153. target_link_libraries(${target} PRIVATE ql_app_img_at)
  154. endif(QL_APP_FEATURE_APP_IMG_AT)
  155. if(QL_APP_FEATURE_RTC)
  156. target_link_libraries(${target} PRIVATE ql_app_rtc)
  157. endif()
  158. if(QL_APP_FEATURE_ALI_LINKSDK)
  159. target_link_libraries(${target} PRIVATE ql_ali_linkSDK)
  160. endif()
  161. if(QL_APP_FEATURE_QCLOUD_IOT)
  162. target_link_libraries(${target} PRIVATE ql_qcloud_iot)
  163. endif()
  164. if(QL_APP_FEATURE_VIRT_AT)
  165. target_link_libraries(${target} PRIVATE ql_app_virt_at)
  166. endif()
  167. if(QL_APP_FEATURE_HTTP_FOTA)
  168. target_link_libraries(${target} PRIVATE ql_app_http_fota)
  169. endif()
  170. if(QL_APP_FEATURE_FTP_FOTA)
  171. target_link_libraries(${target} PRIVATE ql_app_ftp_fota)
  172. endif()
  173. if(QL_APP_FEATURE_I2C)
  174. target_link_libraries(${target} PRIVATE ql_app_i2c)
  175. endif()
  176. if(QL_APP_FEATURE_FS_NAND_FLASH)
  177. target_link_libraries(${target} PRIVATE ql_app_fs_nand_flash)
  178. endif()
  179. if(QL_APP_FEATURE_FS_NOR_FLASH)
  180. target_link_libraries(${target} PRIVATE ql_app_fs_nor_flash)
  181. endif()
  182. if(QL_APP_FEATURE_SDMMC)
  183. target_link_libraries(${target} PRIVATE ql_app_sdmmc)
  184. endif()
  185. if(QL_APP_FEATURE_USBNET)
  186. target_link_libraries(${target} PRIVATE ql_app_usbnet)
  187. endif()
  188. if(QL_APP_FEATURE_SFTP)
  189. target_link_libraries(${target} PRIVATE ql_app_sftp)
  190. endif()
  191. if(QL_APP_FEATURE_MXML)
  192. target_link_libraries(${target} PRIVATE ql_app_mxml)
  193. endif()
  194. if(QL_APP_FEATURE_CLOUDOTA)
  195. target_link_libraries(${target} PRIVATE ql_app_cloudota)
  196. endif()
  197. if(QL_APP_FEATURE_EMBED_NOR_FLASH)
  198. target_link_libraries(${target} PRIVATE ql_app_embed_nor_flash)
  199. endif()
  200. if(QL_APP_FEATURE_EXT_NOR_FLASH)
  201. target_link_libraries(${target} PRIVATE ql_app_ext_nor_flash)
  202. endif()
  203. if(QL_APP_FEATURE_HILINK)
  204. target_link_libraries(${target} PRIVATE ql_app_hilinksdk)
  205. target_link_libraries(${target} PRIVATE ql_app_hilinksdk ql_hilinksdk ${libm_file_name})
  206. endif()
  207. if(QL_APP_FEATURE_GPRS_DATA_TRANSFER)
  208. target_link_libraries(${target} PRIVATE ql_app_gprs_data_transfer)
  209. endif()
  210. if(QL_APP_FEATURE_TP)
  211. target_link_libraries(${target} PRIVATE ql_app_tp)
  212. endif()
  213. if(QL_APP_FEATURE_ALIOTSMARTCARD)
  214. target_link_libraries(${target} PRIVATE ql_app_aliotsmartcard)
  215. endif()
  216. if (QL_APP_FEATURE_ALIPAY_IOT_SDK)
  217. target_link_libraries(${target} PRIVATE ql_app_alipay_iot)
  218. endif()
  219. if(QL_APP_FEATURE_NTRIP_RTK)
  220. target_link_libraries(${target} PRIVATE ql_app_ntrip_rtk)
  221. endif()
  222. if(QL_APP_FEATURE_ETHERNET)
  223. target_link_libraries(${target} PRIVATE ql_app_ethernet)
  224. endif()
  225. endif()
  226. relative_glob(srcs *.h *.c)
  227. beautify_c_code(${target} ${srcs})
  228. endif()