CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright (C) 2018 LongSung Technologies Limited and/or its affiliates("LongSung").
  2. # All rights reserved.
  3. #
  4. # This software is supplied "AS IS" without any warranties.
  5. # LongSung assumes no responsibility or liability for the use of the software,
  6. # conveys no license or title under any patent, copyright, or mask work
  7. # right to the product. LongSung reserves the right to make changes in the
  8. # software without notification. LongSung also make no representation or
  9. # warranty that such application will be suitable for the specified use
  10. # without further testing or modification.
  11. set(preset_dir ./preset)
  12. set(app_dir ./app)
  13. set(app_file ./hpocapp.c
  14. ${app_dir}/board.c
  15. ${app_dir}/app.c
  16. ${app_dir}/setting.c
  17. ${app_dir}/poc.c
  18. ${app_dir}/uio.c
  19. ${app_dir}/uiEntry.c
  20. ${app_dir}/uiBlock.c
  21. ${app_dir}/gpsCtl.c
  22. ${app_dir}/message.c
  23. ${app_dir}/hook.c
  24. ${app_dir}/appAuth.c
  25. ${app_dir}/common.c
  26. ${app_dir}/bsp.c)
  27. set(log_dir ${app_dir}/log)
  28. set(log_file ${log_dir}/log.c)
  29. set(lcd_dir ${app_dir}/GUI)
  30. set(lcd_file ${lcd_dir}/fonts.c
  31. ${lcd_dir}/gui.c
  32. ${lcd_dir}/lcdDrv.c)
  33. set(fonts_dir ${app_dir}/fonts)
  34. set(fonts_file ${fonts_dir}/GB2312UnicodeTable.c
  35. ${fonts_dir}/strnormalize.c
  36. ${fonts_dir}/unicode.c
  37. ${fonts_dir}/language.c)
  38. set(interface_dir ${app_dir}/Interface)
  39. set(interface_file ${interface_dir}/Palace.c
  40. ${interface_dir}/uiMenu.c
  41. ${interface_dir}/ListBox.c
  42. ${interface_dir}/ListBoxSMS.c
  43. ${interface_dir}/NumEdit.c
  44. ${interface_dir}/ManageMessage.c)
  45. set(md5_dir ${app_dir}/md5)
  46. set(md5_file ${md5_dir}/mymd5.c)
  47. set(all_dir ${app_dir}
  48. ${log_dir}
  49. ${lcd_dir}
  50. ${fonts_dir}
  51. ${interface_dir}
  52. ${md5_dir})
  53. set(all_file ${app_file}
  54. ${log_file}
  55. ${lcd_file}
  56. ${interface_file}
  57. ${md5_file}
  58. ${fonts_file})
  59. set(cy_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpoc.a)
  60. set(language_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libfontlib.a)
  61. ##################################################################################
  62. #aux_source_directory(${SOURCE_TOP_DIR}/hpoc/app SRC_LIST)
  63. include_directories(${all_dir})
  64. #add_definitions(-Wall)
  65. add_definitions(-w)
  66. set(preset_dir ${CMAKE_CURRENT_SOURCE_DIR}/preset)
  67. if(CONFIG_APPIMG_LOAD_FLASH)
  68. set(target Q800_LS_CY)
  69. add_appimg(${target} ${flash_ldscript} ${all_file})
  70. #app usr hgs_lib has to be link first
  71. target_link_libraries(${target} PRIVATE ${cy_lib})
  72. target_link_libraries(${target} PRIVATE ${language_lib})
  73. target_link_libraries(${target} PRIVATE ${libc_file_name} ${libm_file_name} ${libgcc_file_name})
  74. set(pac_file ${out_hex_dir}/${target}.pac)
  75. set(target_img_file ${out_hex_dir}/${target}.img)
  76. pac_init_fdl(init_fdl)
  77. if(preset_dir)
  78. file(REMOVE ${preset_dir}/.gitkeep)
  79. file(GLOB_RECURSE preset_files ${preset_dir}/*)
  80. foreach(preset ${preset_files})
  81. string(REGEX REPLACE ${preset_dir}/ "" preset_file ${preset})
  82. message("find preset file ${preset_file} in dir ${preset_dir}")
  83. set(pkt_preset_flies
  84. ${pkt_preset_flies}
  85. cfg-pack-file -i ${preset_file} -p ${preset_dir}/${preset_file} -n /${preset_file}
  86. )
  87. message("cmd ${pkt_preset_flies}")
  88. endforeach(preset)
  89. endif(preset_dir)
  90. add_custom_command(OUTPUT ${pac_file}
  91. COMMAND python3 ${pacgen_py} ${init_fdl}
  92. cfg-image -i APPIMG -a ${CONFIG_APPIMG_FLASH_ADDRESS}
  93. -s ${CONFIG_APPIMG_FLASH_SIZE}
  94. -p ${target_img_file}
  95. ${pkt_preset_flies}
  96. pac-gen ${pac_file}
  97. DEPENDS ${pacgen_py} ${target_img_file}
  98. WORKING_DIRECTORY ${SOURCE_TOP_DIR}
  99. )
  100. add_custom_target(${target}_pacgen ALL DEPENDS ${pac_file})
  101. endif()