# 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. option(ENABLE_DEBUG "enable_debug_fun" ON) if(ENABLE_DEBUG) add_definitions(-D ENABLE_DEBUG) set(debug_files ./app/debug.c) endif(ENABLE_DEBUG) #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}/GpsData.c ${app_dir}/message.c ${app_dir}/hook.c ${app_dir}/appAuth.c ${app_dir}/common.c ${app_dir}/bsp.c ${app_dir}/ble.c ${app_dir}/xinbiao.c ${app_dir}/tupApi.c ${app_dir}/AppTcpPart.c ${debug_files}) 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(fonts_dir ${app_dir}/fonts) set(fonts_file ${fonts_dir}/GB2312UnicodeTable.c ${fonts_dir}/strnormalize.c ${fonts_dir}/unicode.c ${fonts_dir}/language.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 ${interface_dir}/checkbox.c ${interface_dir}/newMessage.c) set(md5_dir ${app_dir}/md5) set(md5_file ${md5_dir}/mymd5.c) set(all_dir ${app_dir} ${log_dir} ${lcd_dir} ${fonts_dir} ${interface_dir} ${md5_dir}) set(all_file ${app_file} ${log_file} ${lcd_file} ${interface_file} ${md5_file} ${fonts_file}) set(cy_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpoc.a) set(language_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libfontlib.a) ################################################################################## #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 LC_D29V) add_appimg(${target} ${flash_ldscript} ${all_file}) #app usr hgs_lib has to be link first target_link_libraries(${target} PRIVATE ${cy_lib}) target_link_libraries(${target} PRIVATE ${language_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) set(prepack_cpio ${out_hex_dir}/${target}_prepack.cpio) 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 ${prepack_cpio} COMMAND python3 ${modemgen_py} prepackgen --source-top ${SOURCE_TOP_DIR} --binary-top ${BINARY_TOP_DIR} --prepackfile ${CONFIG_PACKAGE_FILE_APPIMG_JSON_PATH} ${prepack_cpio} DEPENDS ${modemgen_py} WORKING_DIRECTORY ${SOURCE_TOP_DIR} ) if(CONFIG_PACKAGE_FILE_APPIMG_JSON_PATH) set(cfg_pack_gpio cfg-pack-cpio -i PREPACK -p ${prepack_cpio}) set(prepack_file ${prepack_cpio}) endif() 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} ${cfg_pack_gpio} pac-gen ${pac_file} DEPENDS ${pacgen_py} ${target_img_file} ${prepack_file} WORKING_DIRECTORY ${SOURCE_TOP_DIR} ) add_custom_target(${target}_pacgen ALL DEPENDS ${pac_file}) endif()