233 lines
6.0 KiB
CMake
233 lines
6.0 KiB
CMake
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)
|
|
add_subdirectory(af)
|
|
endif()
|
|
if (RKAIQ_HAVE_AIE_V10)
|
|
add_subdirectory(aie)
|
|
endif()
|
|
if (RKAIQ_HAVE_MERGE_V10 OR RKAIQ_HAVE_MERGE_V11 OR RKAIQ_HAVE_MERGE_V12)
|
|
add_subdirectory(amerge)
|
|
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)
|
|
add_subdirectory(adrc)
|
|
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)
|
|
add_subdirectory(acp)
|
|
endif()
|
|
if (RKAIQ_HAVE_DEHAZE_V10 OR RKAIQ_HAVE_DEHAZE_V11 OR RKAIQ_HAVE_DEHAZE_V11_DUO OR RKAIQ_HAVE_DEHAZE_V12)
|
|
add_subdirectory(adehaze)
|
|
endif()
|
|
if (RKAIQ_HAVE_3DLUT_V1)
|
|
add_subdirectory(a3dlut)
|
|
endif()
|
|
if (RKAIQ_HAVE_BLC_V1)
|
|
add_subdirectory(ablc)
|
|
endif()
|
|
if (RKAIQ_HAVE_BLC_V32)
|
|
add_subdirectory(ablcV32)
|
|
endif()
|
|
if (RKAIQ_HAVE_CCM_V1 OR RKAIQ_HAVE_CCM_V2)
|
|
add_subdirectory(accm)
|
|
endif()
|
|
if (RKAIQ_HAVE_CGC_V1)
|
|
add_subdirectory(acgc)
|
|
endif()
|
|
if (RKAIQ_HAVE_DEBAYER_V1 OR RKAIQ_HAVE_DEBAYER_V2 OR RKAIQ_HAVE_DEBAYER_V2_LITE)
|
|
add_subdirectory(adebayer)
|
|
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)
|
|
add_subdirectory(agamma)
|
|
endif()
|
|
if (RKAIQ_HAVE_DEGAMMA_V1)
|
|
add_subdirectory(adegamma)
|
|
endif()
|
|
if (RKAIQ_HAVE_GIC_V1 OR RKAIQ_HAVE_GIC_V2)
|
|
add_subdirectory(agic)
|
|
endif()
|
|
if (RKAIQ_HAVE_LDCH_V10 OR RKAIQ_HAVE_LDCH_V21)
|
|
add_subdirectory(aldch)
|
|
endif()
|
|
if (RKAIQ_HAVE_LSC_V1 OR RKAIQ_HAVE_LSC_V2 OR RKAIQ_HAVE_LSC_V3)
|
|
add_subdirectory(alsc)
|
|
endif()
|
|
if (RKAIQ_HAVE_ORB_V1)
|
|
add_subdirectory(aorb)
|
|
endif()
|
|
if (RKAIQ_HAVE_CSM_V1)
|
|
add_subdirectory(acsm)
|
|
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)
|
|
add_subdirectory(again2)
|
|
endif()
|
|
if (RKAIQ_HAVE_YNR_V3)
|
|
add_subdirectory(aynr3)
|
|
endif()
|
|
if (RKAIQ_HAVE_YNR_V22)
|
|
add_subdirectory(aynrV22)
|
|
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)
|
|
add_subdirectory(asharpV33)
|
|
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)
|
|
add_subdirectory(abayertnrV23)
|
|
endif()
|
|
if (RKAIQ_HAVE_CNR_V30 OR RKAIQ_HAVE_CNR_V30_LITE)
|
|
add_subdirectory(acnrV30)
|
|
endif()
|
|
if (RKAIQ_HAVE_CAC_V03 OR RKAIQ_HAVE_CAC_V10 OR RKAIQ_HAVE_CAC_V11)
|
|
add_subdirectory(acac)
|
|
endif()
|
|
if (RKAIQ_HAVE_DPCC_V1)
|
|
add_subdirectory(adpcc)
|
|
endif()
|