1cmake_minimum_required(VERSION 2.8.0...3.22) 2 3project(iqconvert) 4 5set(ROOT_PROJ_DIR ${PROJECT_SOURCE_DIR}/../..) 6set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11") 7add_compile_options(-fPIC -Wall -Wno-error -O0 -g) 8add_compile_options(-Wno-unused-variable 9 -Wno-unused-but-set-variable 10 -Wno-unused-function 11 -Wno-misleading-indentation 12 -Wno-unused-label 13 -Wno-format-truncation 14 -fno-strict-aliasing) 15 16 17include_directories( 18 ${ROOT_PROJ_DIR} 19 ${ROOT_PROJ_DIR}/iq_parser 20 ${ROOT_PROJ_DIR}/iq_parser_v2 21 ${ROOT_PROJ_DIR}/xcore 22 ${ROOT_PROJ_DIR}/xcore/base 23 ${ROOT_PROJ_DIR}/include/iq_parser 24 ${ROOT_PROJ_DIR}/iq_parser 25 ${ROOT_PROJ_DIR}/iq_parser_v2 26 ${ROOT_PROJ_DIR}/include/algos 27 ${ROOT_PROJ_DIR}/include/xcore 28 ${ROOT_PROJ_DIR}/include/xcore/base 29 ${ROOT_PROJ_DIR}/include/common 30 ${ROOT_PROJ_DIR}/include/uAPI 31 ) 32 33set(CALIBV1_SRC 34 ${ROOT_PROJ_DIR}/iq_parser_v2/awb_xml2json.cpp 35 ${ROOT_PROJ_DIR}/iq_parser/RkAiqCalibDb.cpp 36 ${ROOT_PROJ_DIR}/iq_parser/RkAiqCalibApi.cpp 37 ${ROOT_PROJ_DIR}/iq_parser/RkAiqCalibParser.cpp 38 ${ROOT_PROJ_DIR}/iq_parser/RkAiqCalibTag.cpp 39 ${ROOT_PROJ_DIR}/iq_parser/RkAiqCalibApi.cpp 40 ${ROOT_PROJ_DIR}/iq_parser/tinyxml2.cpp 41 ${ROOT_PROJ_DIR}/iq_parser/xmltags.cpp 42 ${ROOT_PROJ_DIR}/xcore/xcam_log.cpp 43 ) 44 45set(CALIBV2_SRC 46 ${ROOT_PROJ_DIR}/iq_parser_v2/aec_xml2json.cpp 47 ${ROOT_PROJ_DIR}/iq_parser_v2/ccm_xml2json.cpp 48 ${ROOT_PROJ_DIR}/iq_parser_v2/j2s/cJSON.c 49 ${ROOT_PROJ_DIR}/iq_parser_v2/j2s/cJSON_Utils.c 50 ${ROOT_PROJ_DIR}/iq_parser_v2/j2s/j2s.c 51 ${ROOT_PROJ_DIR}/iq_parser_v2/j2s/j2s_utils.c 52 ${ROOT_PROJ_DIR}/iq_parser_v2/RkAiqCalibDbV2.cpp 53 ${ROOT_PROJ_DIR}/iq_parser_v2/bayernr_xml2json_v1.cpp 54 ${ROOT_PROJ_DIR}/iq_parser_v2/mfnr_xml2json_v1.cpp 55 ${ROOT_PROJ_DIR}/iq_parser_v2/uvnr_xml2json_v1.cpp 56 ${ROOT_PROJ_DIR}/iq_parser_v2/ynr_xml2json_v1.cpp 57 ${ROOT_PROJ_DIR}/iq_parser_v2/sharp_xml2json_v1.cpp 58 ${ROOT_PROJ_DIR}/iq_parser_v2/edgefilter_xml2json_v1.cpp 59 ${ROOT_PROJ_DIR}/iq_parser_v2/bayernr_xml2json_v2.cpp 60 ${ROOT_PROJ_DIR}/iq_parser_v2/cnr_xml2json_v1.cpp 61 ${ROOT_PROJ_DIR}/iq_parser_v2/ynr_xml2json_v2.cpp 62 ${ROOT_PROJ_DIR}/iq_parser_v2/sharp_xml2json_v3.cpp 63 ${ROOT_PROJ_DIR}/iq_parser_v2/adrc_xml2json.cpp 64 ${ROOT_PROJ_DIR}/iq_parser_v2/af_xml2json.cpp 65 ${ROOT_PROJ_DIR}/iq_parser_v2/adehaze_xml2json.cpp 66 ${ROOT_PROJ_DIR}/iq_parser_v2/lut3d_xml2json.cpp 67 ) 68 69include_directories(${ROOT_PROJ_DIR}/include) 70include_directories(${ROOT_PROJ_DIR}/include/common) 71include_directories(${ROOT_PROJ_DIR}/include/iq_parser_v2) 72include_directories(${ROOT_PROJ_DIR}/include/iq_parser_v2/j2s) 73include_directories(${PROJECT_SOURCE_DIR}/include) 74 75add_compile_options(${ISP_HW_VERSION}) 76 77######################################################### 78# JSON <---> STRUCT PREPROCESS # 79######################################################### 80add_custom_target( 81 j2s_parser 82 COMMAND ${CMAKE_C_COMPILER} 83 ${ROOT_PROJ_DIR}/include/iq_parser_v2/RkAiqCalibDbTypesV2.h -E -C -o .temp.h ${ISP_HW_VERSION} 84 -I${ROOT_PROJ_DIR}/include/common 85 -I${ROOT_PROJ_DIR}/include/uAPI 86 -I${ROOT_PROJ_DIR}/include/algos 87 COMMAND ${PROJECT_SOURCE_DIR}/script/header_strip.sh 88 .temp.h output.h 89 COMMAND ${PROJECT_SOURCE_DIR}/script/headerprocess.sh 90 ${ROOT_PROJ_DIR}/include/iq_parser_v2/RkAiqCalibDbTypesV2.h 91 ${ROOT_PROJ_DIR}/include/iq_parser_v2/j2s/j2s_generated.h 92 COMMAND ${PROJECT_SOURCE_DIR}/bin/parser output.h >> 93 ${ROOT_PROJ_DIR}/include/iq_parser_v2/j2s/j2s_generated.h 94 ) 95 96######################################################### 97# BUILD LIBRARY # 98######################################################### 99add_library(iqconvert STATIC ${CALIBV1_SRC} ${CALIBV2_SRC}) 100add_dependencies(iqconvert j2s_parser) 101 102######################################################### 103# BUILD TOOL # 104######################################################### 105add_executable(iqConverTer main.cpp src/iqconverter.cpp) 106target_link_libraries(iqConverTer iqconvert) 107 108install(TARGETS iqConverTer DESTINATION bin) 109 110