if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() cmake_minimum_required(VERSION 2.8...3.22) # surpress CXX_VISIBILITY_PRESET warning if (POLICY CMP0063) # Visibility cmake_policy(SET CMP0063 NEW) endif (POLICY CMP0063) include_directories( ../xcore ../xcore/base ) if(WIN32) set(PREFIX ) set(SUFFIX lib) else() set(PREFIX ${LIBRARY_OUTPUT_PATH}/lib) set(SUFFIX a) endif() if (${CMAKE_SYSTEM_NAME} EQUAL "") set(OS "linux") else() string(TOLOWER ${CMAKE_SYSTEM_NAME} OS) endif() if (${C_LIBRARY_NAME} EQUAL "") set(C_LIBRARY_NAME "glibc" CACHE INTERNAL "" FORCE) endif() string(TOLOWER ${RKAIQ_TARGET_SOC} SOC) macro(dec_algo_v name version chk_file src_list) set(_src_list ${src_list} ${ARGN} ) set(PREBUILT_DIR "${CMAKE_CURRENT_LIST_DIR}/${OS}/${SOC}/${ARCH}/${C_LIBRARY_NAME}") set(LIBPREFIX "${PREBUILT_DIR}/lib") if (${version} EQUAL 0) set(target_name "rkaiq_${name}") set(target_folder "algos/${name}") else() set(target_name "rkaiq_${name}_v${version}") set(target_folder "algos/${name}${version}") endif() if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${chk_file}") add_library(${target_name} STATIC ${_src_list}) set_target_properties(${target_name} PROPERTIES FOLDER "${target_folder}") set_target_properties(${target_name} PROPERTIES CLEAN_DIRECT_OUTPUT 1) set_target_properties(${target_name} PROPERTIES C_VISIBILITY_PRESET default) set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET default) if (${RKAIQ_INSTALL_ALGOS_LIB}) install(TARGETS ${target_name} ARCHIVE DESTINATION ${PREBUILT_DIR}) endif() else() message(STATUS "Can NOT found ${CMAKE_CURRENT_SOURCE_DIR}/${chk_file}. Using lib") add_library(${target_name} STATIC IMPORTED GLOBAL) set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION "${LIBPREFIX}${target_name}.${SUFFIX}") set_target_properties(${target_name} PROPERTIES IMPORTED_IMPLIB "${LIBPREFIX}${target_name}.${SUFFIX}") endif() endmacro(dec_algo_v) macro(dec_algo name chk_file src_list) set(_src_list ${src_list} ${ARGN}) dec_algo_v(${name} 0 ${chk_file} ${_src_list}) endmacro(dec_algo) if (RKAIQ_HAVE_AE_V1) add_subdirectory(ae) endif() add_subdirectory(awb) if (RKAIQ_HAVE_AF_V20 OR RKAIQ_ONLY_AF_STATS_V20 OR RKAIQ_HAVE_AF_V30 OR RKAIQ_ONLY_AF_STATS_V30 OR RKAIQ_HAVE_AF_V31 OR RKAIQ_ONLY_AF_STATS_V31 OR RKAIQ_HAVE_AF_V32_LITE OR RKAIQ_ONLY_AF_STATS_V32_LITE OR RKAIQ_HAVE_AF_V33 OR RKAIQ_ONLY_AF_STATS_V33) add_subdirectory(af) endif() if (RKAIQ_HAVE_AIE_V10) if(RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/ie) else() add_subdirectory(aie) endif() endif() if (RKAIQ_HAVE_MERGE_V10 OR RKAIQ_HAVE_MERGE_V11 OR RKAIQ_HAVE_MERGE_V12) if(RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/merge) else() add_subdirectory(amerge) endif() endif() if (RKAIQ_HAVE_TMO_V1) add_subdirectory(atmo) endif() if (RKAIQ_HAVE_DRC_V10 OR RKAIQ_HAVE_DRC_V11 OR RKAIQ_HAVE_DRC_V12 OR RKAIQ_HAVE_DRC_V12_LITE OR RKAIQ_HAVE_DRC_V20) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/drc) else() add_subdirectory(adrc) endif() endif() if (RKAIQ_HAVE_RGBIR_REMOSAIC) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/rgbir) else() add_subdirectory(argbir) endif() endif() if (RKAIQ_HAVE_ANR_V1) add_subdirectory(anr) endif() if (RKAIQ_HAVE_SHARP_V1) add_subdirectory(asharp) endif() if (RKAIQ_HAVE_ASD_V10) add_subdirectory(asd) endif() if (RKAIQ_HAVE_ACP_V10) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/cp) else() add_subdirectory(acp) endif() endif() if (RKAIQ_HAVE_DEHAZE_V10 OR RKAIQ_HAVE_DEHAZE_V11 OR RKAIQ_HAVE_DEHAZE_V11_DUO OR RKAIQ_HAVE_DEHAZE_V12 OR RKAIQ_HAVE_DEHAZE_V14) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/dehaze) add_subdirectory(newStruct/histeq) else() add_subdirectory(adehaze) endif() endif() if(RKAIQ_HAVE_HISTEQ_V10) add_subdirectory(newStruct/histeq) endif() if(RKAIQ_HAVE_ENHANCE_V10) add_subdirectory(newStruct/enh) endif() if(RKAIQ_HAVE_HSV_V10) add_subdirectory(newStruct/hsv) endif() if (RKAIQ_HAVE_3DLUT_V1) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/3dlut) else() add_subdirectory(a3dlut) endif() endif() if (RKAIQ_HAVE_BLC_V1) add_subdirectory(ablc) endif() if (RKAIQ_HAVE_BLC_V32) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/blc) else() add_subdirectory(ablcV32) endif() endif() if (RKAIQ_HAVE_CCM_V1 OR RKAIQ_HAVE_CCM_V2 OR RKAIQ_HAVE_CCM_V3) if (RKAIQ_NEWSTRUCT_TEST AND RKAIQ_HAVE_CCM_V3) add_subdirectory(newStruct/ccm) else() add_subdirectory(accm) endif() endif() if (RKAIQ_HAVE_CGC_V1) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/cgc) else() add_subdirectory(acgc) endif() endif() if (RKAIQ_HAVE_DEBAYER) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/demosaic) else() add_subdirectory(adebayer) endif() endif() if (RKAIQ_HAVE_AFD_V1 OR RKAIQ_HAVE_AFD_V2) add_subdirectory(afd) endif() if (RKAIQ_HAVE_FEC_V10) add_subdirectory(afec) endif() if (RKAIQ_HAVE_GAMMA_V10 OR RKAIQ_HAVE_GAMMA_V11) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/gamma) else() add_subdirectory(agamma) endif() endif() if (RKAIQ_HAVE_DEGAMMA_V1) add_subdirectory(adegamma) endif() if (RKAIQ_HAVE_GIC_V1) add_subdirectory(agic) endif() if (RKAIQ_HAVE_GIC_V2 OR RKAIQ_HAVE_GIC_V3) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/gic) else() add_subdirectory(agic) endif() endif() if (RKAIQ_HAVE_LDCH_V10 OR RKAIQ_HAVE_LDCH_V21) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/ldch) else() add_subdirectory(aldch) endif() endif() if (RKAIQ_HAVE_LSC_V1 OR RKAIQ_HAVE_LSC_V2 OR RKAIQ_HAVE_LSC_V3) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/lsc) else() add_subdirectory(alsc) endif() endif() if (RKAIQ_HAVE_ORB_V1) add_subdirectory(aorb) endif() if (RKAIQ_HAVE_CSM_V1) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/csm) else() add_subdirectory(acsm) endif() endif() if (RKAIQ_HAVE_WDR_V1) add_subdirectory(awdr) endif() if (RKAIQ_HAVE_SHARP_V3) add_subdirectory(asharp3) endif() if (RKAIQ_HAVE_YNR_V2) add_subdirectory(aynr2) endif() if (RKAIQ_HAVE_CNR_V1) add_subdirectory(acnr) endif() if (RKAIQ_HAVE_BAYERNR_V2) add_subdirectory(arawnr2) endif() if (RKAIQ_HAVE_EIS_V1) add_subdirectory(aeis) endif() if (RKAIQ_HAVE_AMD_V1) add_subdirectory(amd) endif() if (RKAIQ_HAVE_BAYERNR_V1) add_subdirectory(arawnr) endif() if (RKAIQ_HAVE_YNR_V1) add_subdirectory(aynr) endif() if (RKAIQ_HAVE_UVNR_V1) add_subdirectory(auvnr) endif() if (RKAIQ_HAVE_MFNR_V1) add_subdirectory(amfnr) endif() if (RKAIQ_HAVE_GAIN_V1) add_subdirectory(again) endif() if (RKAIQ_HAVE_GAIN_V2) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/gain) else() add_subdirectory(again2) endif() endif() if (RKAIQ_HAVE_YNR_V3) add_subdirectory(aynr3) endif() if (RKAIQ_HAVE_YNR_V22) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/ynr) else() add_subdirectory(aynrV22) endif() endif() if (RKAIQ_HAVE_YNR_V24 OR RKAIQ_HAVE_YNR_V40) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/ynr) else() add_subdirectory(aynrV24) endif() endif() if (RKAIQ_HAVE_CNR_V2) add_subdirectory(acnr2) endif() if (RKAIQ_HAVE_SHARP_V4) add_subdirectory(asharp4) endif() if (RKAIQ_HAVE_SHARP_V33 OR RKAIQ_HAVE_SHARP_V33_LITE) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/sharp) else() add_subdirectory(asharpV33) endif() endif() if (RKAIQ_HAVE_SHARP_V34 OR RKAIQ_HAVE_SHARP_V40) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/sharp) else() add_subdirectory(asharpV34) endif() endif() if (RKAIQ_HAVE_BAYER2DNR_V2) add_subdirectory(abayer2dnr2) endif() if (RKAIQ_HAVE_BAYER2DNR_V23) add_subdirectory(abayer2dnrV23) endif() if (RKAIQ_HAVE_BAYERTNR_V2) add_subdirectory(abayertnr2) endif() if (RKAIQ_HAVE_BAYERTNR_V23 OR RKAIQ_HAVE_BAYERTNR_V23_LITE) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/bayertnr) else() add_subdirectory(abayertnrV23) endif() endif() if (RKAIQ_HAVE_BAYERTNR_V30 OR RKAIQ_HAVE_BAYERTNR_V41) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/bayertnr) else() add_subdirectory(abayertnrV30) endif() endif() if (RKAIQ_HAVE_CNR_V30 OR RKAIQ_HAVE_CNR_V30_LITE) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/cnr) else() add_subdirectory(acnrV30) endif() endif() if (RKAIQ_HAVE_CAC_V03 OR RKAIQ_HAVE_CAC_V10 OR RKAIQ_HAVE_CAC_V11 OR RKAIQ_HAVE_CAC_V30) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/cac) else() add_subdirectory(acac) endif() endif() if (RKAIQ_HAVE_DPCC_V1 OR RKAIQ_HAVE_DPCC_V2) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/dpc) else() add_subdirectory(adpcc) endif() endif() if (RKAIQ_HAVE_YUVME_V1) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/yme) else() add_subdirectory(ayuvmeV1) endif() endif() if (RKAIQ_HAVE_CNR_V31 OR RKAIQ_HAVE_CNR_V35) if (RKAIQ_NEWSTRUCT_TEST) add_subdirectory(newStruct/cnr) else() add_subdirectory(acnrV31) endif() endif() if (RKAIQ_HAVE_LDC) add_subdirectory(aldc) endif()