# Copyright (C) 2018 LongSung Technologies Limited and/or its affiliates("LongSung"). # All rights reserved. # # This software is supplied "AS IS" without any warranties. # LongSung assumes no responsibility or liability for the use of the software, # conveys no license or title under any patent, copyright, or mask work # right to the product. LongSung reserves the right to make changes in the # software without notification. LongSung also make no representation or # warranty that such application will be suitable for the specified use # without further testing or modification. set(preset_dir ./preset) set(app_dir ./app) set(app_file ./hpocapp.c ${app_dir}/board.c ${app_dir}/app.c ${app_dir}/setting.c ${app_dir}/poc.c ${app_dir}/uio.c ${app_dir}/uiEntry.c ${app_dir}/uiBlock.c ${app_dir}/gpsCtl.c ${app_dir}/message.c ${app_dir}/hook.c ${app_dir}/appAuth.c ${app_dir}/common.c) set(log_dir ${app_dir}/log) set(log_file ${log_dir}/log.c) set(lcd_dir ${app_dir}/GUI) set(lcd_file ${lcd_dir}/fonts.c ${lcd_dir}/gui.c ${lcd_dir}/lcdDrv.c) set(interface_dir ${app_dir}/Interface) set(interface_file ${interface_dir}/Palace.c ${interface_dir}/uiMenu.c ${interface_dir}/ListBox.c ${interface_dir}/ListBoxSMS.c ${interface_dir}/NumEdit.c ${interface_dir}/ManageMessage.c) set(md5_dir ${app_dir}/md5) set(md5_file ${md5_dir}/mymd5.c) set(BNDinc_dir ${app_dir}/BNDinc) set(BNDinc_file ${BNDinc_dir}/bndapp.c ${BNDinc_dir}/bsp.c) set(png_dir ${app_dir}/png_decoder) set(pnginc_file ${png_dir}/lodepng.c) set(all_dir ${app_dir} ${log_dir} ${lcd_dir} ${interface_dir} ${md5_dir} ${BNDinc_dir} ${png_dir} ) set(all_file ${app_file} ${log_file} ${lcd_file} ${interface_file} ${md5_file} ${BNDinc_file} ${pnginc_file} ) option(USE_HPOC_POC "enable USE_HPOC_POC" OFF) option(USE_BND_POC "enable USE_BND_POC" ON) if(USE_HPOC_POC) add_definitions(-D USE_HPOC_POC) set(hgs_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libohpoc.a) endif() if(USE_BND_POC) add_definitions(-D USE_BND_POC) set(bnd_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/broad.a) set(language_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libfontlib.a) set(qrcode_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libqrcode.a) endif() ################################################################################## #aux_source_directory(${SOURCE_TOP_DIR}/hpoc/app SRC_LIST) include_directories(${all_dir}) #add_definitions(-Wall) add_definitions(-w) set(preset_dir ${CMAKE_CURRENT_SOURCE_DIR}/preset) if(CONFIG_APPIMG_LOAD_FLASH) set(target Q800) add_appimg(${target} ${flash_ldscript} ${all_file}) #app usr hgs_lib has to be link first target_link_libraries(${target} PRIVATE ${hgs_lib}) target_link_libraries(${target} PRIVATE ${bnd_lib}) target_link_libraries(${target} PRIVATE ${language_lib}) target_link_libraries(${target} PRIVATE ${qrcode_lib}) target_link_libraries(${target} PRIVATE ${libc_file_name} ${libm_file_name} ${libgcc_file_name}) set(pac_file ${out_hex_dir}/${target}.pac) set(target_img_file ${out_hex_dir}/${target}.img) pac_init_fdl(init_fdl) if(preset_dir) file(REMOVE ${preset_dir}/.gitkeep) file(GLOB_RECURSE preset_files ${preset_dir}/*) foreach(preset ${preset_files}) string(REGEX REPLACE ${preset_dir}/ "" preset_file ${preset}) message("find preset file ${preset_file} in dir ${preset_dir}") set(pkt_preset_flies ${pkt_preset_flies} cfg-pack-file -i ${preset_file} -p ${preset_dir}/${preset_file} -n /${preset_file} ) message("cmd ${pkt_preset_flies}") endforeach(preset) endif(preset_dir) add_custom_command(OUTPUT ${pac_file} COMMAND python3 ${pacgen_py} ${init_fdl} cfg-image -i APPIMG -a ${CONFIG_APPIMG_FLASH_ADDRESS} -s ${CONFIG_APPIMG_FLASH_SIZE} -p ${target_img_file} ${pkt_preset_flies} pac-gen ${pac_file} DEPENDS ${pacgen_py} ${target_img_file} WORKING_DIRECTORY ${SOURCE_TOP_DIR} ) add_custom_target(${target}_pacgen ALL DEPENDS ${pac_file}) endif()