CMakeLists.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 (QL_APP_PACK_FILE)
  9. if (QL_CCSDK_BUILD)
  10. set(CONFIG_PACKAGE_FILE_APPIMG_JSON_PATH ${QL_APP_PACK_FILE_JSON_PATH})
  11. else()
  12. set(CONFIG_PACKAGE_FILE_APPIMG_JSON_PATH $ENV{prepack_json_path})
  13. endif()
  14. endif()
  15. if(NOT QL_PROJECT_MIXER AND NOT CONFIG_QUEC_PROJECT_FEATURE_VSIM_ADAPT_STD)
  16. set(target ${QL_APP_BUILD_VER})
  17. if(CONFIG_APPIMG_LOAD_FLASH)
  18. add_appimg_flash_ql_example(${target} ql_init.c)
  19. endif()
  20. if(CONFIG_APPIMG_LOAD_FILE)
  21. add_appimg_file_ql_example(${target} ql_init.c)
  22. endif()
  23. target_link_libraries(${target} PRIVATE ql_app_nw ql_app_peripheral ql_app_osi ql_app_dev ql_app_sim ql_app_power apploader)
  24. if(QL_APP_FEATURE_USB)
  25. target_link_libraries(${target} PRIVATE ql_app_usb)
  26. endif()
  27. if(QL_APP_FEATURE_FILE_ZIP)
  28. target_link_libraries(${target} PRIVATE ql_app_zip)
  29. endif()
  30. if(QL_APP_FEATURE_FTP)
  31. target_link_libraries(${target} PRIVATE ql_app_ftp)
  32. endif()
  33. if(QL_APP_FEATURE_HTTP)
  34. target_link_libraries(${target} PRIVATE ql_app_http)
  35. endif()
  36. if(QL_APP_FEATURE_MMS)
  37. target_link_libraries(${target} PRIVATE ql_app_mms)
  38. endif()
  39. if(QL_APP_FEATURE_MQTT)
  40. target_link_libraries(${target} PRIVATE ql_app_mqtt)
  41. endif()
  42. if(QL_APP_FEATURE_SSL)
  43. target_link_libraries(${target} PRIVATE ql_app_ssl)
  44. endif()
  45. if(QL_APP_FEATURE_PING)
  46. target_link_libraries(${target} PRIVATE ql_app_ping)
  47. endif()
  48. if(QL_APP_FEATURE_NTP)
  49. target_link_libraries(${target} PRIVATE ql_app_ntp)
  50. endif()
  51. if(QL_APP_FEATURE_FIREWALL)
  52. target_link_libraries(${target} PRIVATE ql_app_firewall)
  53. endif()
  54. if(QL_APP_FEATURE_LBS)
  55. target_link_libraries(${target} PRIVATE ql_app_lbs)
  56. endif()
  57. if(QL_APP_FEATURE_QTHSDK)
  58. target_link_libraries(${target} PRIVATE ql_app_qthsdk)
  59. endif()
  60. if(QL_APP_FEATURE_CTSREG)
  61. target_link_libraries(${target} PRIVATE ql_app_ctsreg)
  62. endif()
  63. if(QL_APP_FEATURE_SOCKET)
  64. target_link_libraries(${target} PRIVATE ql_app_socket)
  65. endif()
  66. if(QL_APP_FEATURE_AUDIO)
  67. target_link_libraries(${target} PRIVATE ql_app_audio)
  68. if(QL_APP_FEATURE_TTS)
  69. if(NOT CONFIG_QUEC_PROJECT_FEATURE_TTS_IN_KERNEL)
  70. add_library(ql_tts_api STATIC IMPORTED)
  71. set_target_properties(ql_tts_api PROPERTIES IMPORTED_LOCATION ${SOURCE_TOP_DIR}/components/newlib/armca5/libql_api_tts.a)
  72. target_link_libraries(${target} PRIVATE ql_app_tts ql_tts_api ${libm_file_name})
  73. else()
  74. target_link_libraries(${target} PRIVATE ql_app_tts ${libm_file_name})
  75. endif()
  76. endif()
  77. endif()
  78. if(QL_APP_FEATURE_WIFISCAN)
  79. target_link_libraries(${target} PRIVATE ql_app_wifi_scan)
  80. endif()
  81. if(QL_APP_FEATURE_BT)
  82. target_link_libraries(${target} PRIVATE ql_app_bt)
  83. endif()
  84. if(QL_APP_FEATURE_BT_HFP)
  85. target_link_libraries(${target} PRIVATE ql_app_bt_hfp)
  86. endif()
  87. if(QL_APP_FEATURE_BT_SPP)
  88. target_link_libraries(${target} PRIVATE ql_app_bt_spp)
  89. endif()
  90. if(QL_APP_FEATURE_BT_A2DP_AVRCP)
  91. target_link_libraries(${target} PRIVATE ql_app_bt_a2dp_avrcp)
  92. endif()
  93. if(QL_APP_FEATURE_BLE_GATT)
  94. target_link_libraries(${target} PRIVATE ql_app_ble_gatt)
  95. endif()
  96. if(QL_APP_FEATURE_GNSS)
  97. target_link_libraries(${target} PRIVATE ql_app_gnss)
  98. endif()
  99. if(QL_APP_FEATURE_HD_GNSS)
  100. target_link_libraries(${target} PRIVATE ql_app_hd_gnss)
  101. endif()
  102. if(QL_APP_FEATURE_LCD)
  103. target_link_libraries(${target} PRIVATE ql_app_lcd)
  104. endif()
  105. if(QL_APP_FEATURE_LVGL)
  106. target_link_libraries(${target} PRIVATE ql_app_lvgl)
  107. endif()
  108. if(QL_APP_FEATURE_CAMERA)
  109. target_link_libraries(${target} PRIVATE ql_app_camera)
  110. endif()
  111. if(QL_APP_FEATURE_FILE)
  112. target_link_libraries(${target} PRIVATE ql_app_file)
  113. endif()
  114. if(QL_APP_FEATURE_SMS)
  115. target_link_libraries(${target} PRIVATE ql_app_sms)
  116. endif()
  117. if(QL_APP_FEATURE_VOICE_CALL)
  118. target_link_libraries(${target} PRIVATE ql_app_voice_call)
  119. endif()
  120. if(QL_APP_FEATURE_VOLTE)
  121. target_link_libraries(${target} PRIVATE ql_app_volte)
  122. endif()
  123. if(QL_APP_FEATURE_STK)
  124. target_link_libraries(${target} PRIVATE ql_app_stk)
  125. endif()
  126. if(QL_APP_FEATURE_VSIM_ADAPT)
  127. target_link_libraries(${target} PRIVATE ql_app_vsim_adapt)
  128. endif()
  129. if(QL_APP_FEATURE_SPI)
  130. target_link_libraries(${target} PRIVATE ql_app_spi)
  131. endif()
  132. if(QL_APP_FEATURE_SPI_NOR_FLASH)
  133. target_link_libraries(${target} PRIVATE ql_app_spi_nor_flash)
  134. endif()
  135. if(QL_APP_FEATURE_SPI4_EXT_NOR_SFFS)
  136. target_link_libraries(${target} PRIVATE ql_app_spi4_ext_nor_sffs)
  137. endif()
  138. if(QL_APP_FEATURE_SPI6_EXT_NOR)
  139. target_link_libraries(${target} PRIVATE ql_app_spi6_ext_nor_flash)
  140. endif()
  141. if(QL_APP_FEATURE_SPI_NAND_FLASH)
  142. target_link_libraries(${target} PRIVATE ql_app_spi_nand_flash)
  143. endif()
  144. if(QL_APP_FEATURE_DECODER)
  145. add_library(ql_decoder_api STATIC IMPORTED)
  146. set_target_properties(ql_decoder_api PROPERTIES IMPORTED_LOCATION ${SOURCE_TOP_DIR}/components/newlib/armca5/libql_api_decoder.a)
  147. target_link_libraries(${target} PRIVATE ql_app_decoder ql_decoder_api ${libm_file_name})
  148. endif()
  149. if(QL_APP_FEATURE_APP_IMG_AT)
  150. target_link_libraries(${target} PRIVATE ql_app_img_at)
  151. endif(QL_APP_FEATURE_APP_IMG_AT)
  152. if(QL_APP_FEATURE_RTC)
  153. target_link_libraries(${target} PRIVATE ql_app_rtc)
  154. endif()
  155. if(QL_APP_FEATURE_ALI_LINKSDK)
  156. target_link_libraries(${target} PRIVATE ql_ali_linkSDK)
  157. endif()
  158. if(QL_APP_FEATURE_QCLOUD_IOT)
  159. target_link_libraries(${target} PRIVATE ql_qcloud_iot)
  160. endif()
  161. if(QL_APP_FEATURE_VIRT_AT)
  162. target_link_libraries(${target} PRIVATE ql_app_virt_at)
  163. endif()
  164. if(QL_APP_FEATURE_HTTP_FOTA)
  165. target_link_libraries(${target} PRIVATE ql_app_http_fota)
  166. endif()
  167. if(QL_APP_FEATURE_FTP_FOTA)
  168. target_link_libraries(${target} PRIVATE ql_app_ftp_fota)
  169. endif()
  170. if(QL_APP_FEATURE_I2C)
  171. target_link_libraries(${target} PRIVATE ql_app_i2c)
  172. endif()
  173. if(QL_APP_FEATURE_FS_NAND_FLASH)
  174. target_link_libraries(${target} PRIVATE ql_app_fs_nand_flash)
  175. endif()
  176. if(QL_APP_FEATURE_FS_NOR_FLASH)
  177. target_link_libraries(${target} PRIVATE ql_app_fs_nor_flash)
  178. endif()
  179. if(QL_APP_FEATURE_SDMMC)
  180. target_link_libraries(${target} PRIVATE ql_app_sdmmc)
  181. endif()
  182. if(QL_APP_FEATURE_USBNET)
  183. target_link_libraries(${target} PRIVATE ql_app_usbnet)
  184. endif()
  185. if(QL_APP_FEATURE_SFTP)
  186. target_link_libraries(${target} PRIVATE ql_app_sftp)
  187. endif()
  188. if(QL_APP_FEATURE_MXML)
  189. target_link_libraries(${target} PRIVATE ql_app_mxml)
  190. endif()
  191. if(QL_APP_FEATURE_CLOUDOTA)
  192. target_link_libraries(${target} PRIVATE ql_app_cloudota)
  193. endif()
  194. if(QL_APP_FEATURE_EMBED_NOR_FLASH)
  195. target_link_libraries(${target} PRIVATE ql_app_embed_nor_flash)
  196. endif()
  197. if(QL_APP_FEATURE_EXT_NOR_FLASH)
  198. target_link_libraries(${target} PRIVATE ql_app_ext_nor_flash)
  199. endif()
  200. if(QL_APP_FEATURE_HILINK)
  201. target_link_libraries(${target} PRIVATE ql_app_hilinksdk)
  202. target_link_libraries(${target} PRIVATE ql_app_hilinksdk ql_hilinksdk ${libm_file_name})
  203. endif()
  204. if(QL_APP_FEATURE_GPRS_DATA_TRANSFER)
  205. target_link_libraries(${target} PRIVATE ql_app_gprs_data_transfer)
  206. endif()
  207. if(QL_APP_FEATURE_TP)
  208. target_link_libraries(${target} PRIVATE ql_app_tp)
  209. endif()
  210. if(QL_APP_FEATURE_ALIOTSMARTCARD)
  211. target_link_libraries(${target} PRIVATE ql_app_aliotsmartcard)
  212. endif()
  213. if (QL_APP_FEATURE_ALIPAY_IOT_SDK)
  214. target_link_libraries(${target} PRIVATE ql_app_alipay_iot)
  215. endif()
  216. if(QL_APP_FEATURE_WEBSOCKET)
  217. target_link_libraries(${target} PRIVATE ql_app_websocket)
  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. if(QL_APP_FEATURE_WIFI)
  226. target_link_libraries(${target} PRIVATE ql_app_wifi)
  227. endif()
  228. if(HC_APP_FEATURE_MOID8ID)
  229. target_link_libraries(${target} PRIVATE hc_app_moid8id)
  230. endif()
  231. relative_glob(srcs *.h *.c)
  232. beautify_c_code(${target} ${srcs})
  233. endif()