xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/algos/CMakeLists.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1if(NOT CMAKE_BUILD_TYPE)
2    set(CMAKE_BUILD_TYPE Release CACHE STRING
3        "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
4        FORCE)
5endif()
6
7cmake_minimum_required(VERSION 2.8...3.22)
8
9# surpress CXX_VISIBILITY_PRESET warning
10if (POLICY CMP0063) # Visibility
11    cmake_policy(SET CMP0063 NEW)
12endif (POLICY CMP0063)
13
14include_directories(
15    ../xcore
16    ../xcore/base
17    ./
18    )
19
20if(WIN32)
21    set(PREFIX )
22    set(SUFFIX lib)
23else()
24    set(PREFIX ${LIBRARY_OUTPUT_PATH}/lib)
25    set(SUFFIX a)
26endif()
27
28if (${CMAKE_SYSTEM_NAME} EQUAL "")
29    set(OS "linux")
30else()
31    string(TOLOWER ${CMAKE_SYSTEM_NAME} OS)
32endif()
33
34if (${C_LIBRARY_NAME} EQUAL "")
35    set(C_LIBRARY_NAME "glibc" CACHE INTERNAL "" FORCE)
36endif()
37
38string(TOLOWER ${RKAIQ_TARGET_SOC} SOC)
39
40
41macro(dec_algo_v name version chk_file src_list)
42    set(_src_list ${src_list} ${ARGN} )
43    set(PREBUILT_DIR "${CMAKE_CURRENT_LIST_DIR}/${OS}/${SOC}/${ARCH}/${C_LIBRARY_NAME}")
44    set(LIBPREFIX "${PREBUILT_DIR}/lib")
45    if (${version} EQUAL 0)
46        set(target_name "rkaiq_${name}")
47        set(target_folder "algos/${name}")
48    else()
49        set(target_name "rkaiq_${name}_v${version}")
50        set(target_folder "algos/${name}${version}")
51    endif()
52    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${chk_file}")
53        add_library(${target_name} STATIC ${_src_list})
54        set_target_properties(${target_name} PROPERTIES FOLDER "${target_folder}")
55        set_target_properties(${target_name} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
56        set_target_properties(${target_name} PROPERTIES C_VISIBILITY_PRESET default)
57        set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET default)
58        if (${RKAIQ_INSTALL_ALGOS_LIB})
59            install(TARGETS ${target_name} ARCHIVE DESTINATION ${PREBUILT_DIR})
60        endif()
61    else()
62        message(STATUS "Can NOT found ${CMAKE_CURRENT_SOURCE_DIR}/${chk_file}. Using lib")
63        add_library(${target_name} STATIC IMPORTED GLOBAL)
64        set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION
65            "${LIBPREFIX}${target_name}.${SUFFIX}")
66        set_target_properties(${target_name} PROPERTIES IMPORTED_IMPLIB
67            "${LIBPREFIX}${target_name}.${SUFFIX}")
68    endif()
69endmacro(dec_algo_v)
70
71macro(dec_algo name chk_file src_list)
72    set(_src_list ${src_list} ${ARGN})
73    dec_algo_v(${name} 0 ${chk_file} ${_src_list})
74endmacro(dec_algo)
75
76if (RKAIQ_HAVE_AE_V1)
77add_subdirectory(ae)
78endif()
79add_subdirectory(awb)
80if (RKAIQ_HAVE_AF_V20 OR RKAIQ_ONLY_AF_STATS_V20 OR
81    RKAIQ_HAVE_AF_V30 OR RKAIQ_ONLY_AF_STATS_V30 OR
82    RKAIQ_HAVE_AF_V31 OR RKAIQ_ONLY_AF_STATS_V31 OR
83    RKAIQ_HAVE_AF_V32_LITE OR RKAIQ_ONLY_AF_STATS_V32_LITE)
84add_subdirectory(af)
85endif()
86if (RKAIQ_HAVE_AIE_V10)
87add_subdirectory(aie)
88endif()
89if (RKAIQ_HAVE_MERGE_V10 OR RKAIQ_HAVE_MERGE_V11 OR RKAIQ_HAVE_MERGE_V12)
90add_subdirectory(amerge)
91endif()
92if (RKAIQ_HAVE_TMO_V1)
93add_subdirectory(atmo)
94endif()
95if (RKAIQ_HAVE_DRC_V10 OR RKAIQ_HAVE_DRC_V11 OR RKAIQ_HAVE_DRC_V12 OR RKAIQ_HAVE_DRC_V12_LITE)
96add_subdirectory(adrc)
97endif()
98if (RKAIQ_HAVE_ANR_V1)
99add_subdirectory(anr)
100endif()
101if (RKAIQ_HAVE_SHARP_V1)
102add_subdirectory(asharp)
103endif()
104if (RKAIQ_HAVE_ASD_V10)
105add_subdirectory(asd)
106endif()
107if (RKAIQ_HAVE_ACP_V10)
108add_subdirectory(acp)
109endif()
110if (RKAIQ_HAVE_DEHAZE_V10 OR RKAIQ_HAVE_DEHAZE_V11 OR RKAIQ_HAVE_DEHAZE_V11_DUO OR RKAIQ_HAVE_DEHAZE_V12)
111add_subdirectory(adehaze)
112endif()
113if (RKAIQ_HAVE_3DLUT_V1)
114add_subdirectory(a3dlut)
115endif()
116if (RKAIQ_HAVE_BLC_V1)
117add_subdirectory(ablc)
118endif()
119if (RKAIQ_HAVE_BLC_V32)
120add_subdirectory(ablcV32)
121endif()
122if (RKAIQ_HAVE_CCM_V1 OR RKAIQ_HAVE_CCM_V2)
123add_subdirectory(accm)
124endif()
125if (RKAIQ_HAVE_CGC_V1)
126add_subdirectory(acgc)
127endif()
128if (RKAIQ_HAVE_DEBAYER_V1 OR RKAIQ_HAVE_DEBAYER_V2 OR RKAIQ_HAVE_DEBAYER_V2_LITE)
129add_subdirectory(adebayer)
130endif()
131if (RKAIQ_HAVE_AFD_V1 OR RKAIQ_HAVE_AFD_V2)
132add_subdirectory(afd)
133endif()
134if (RKAIQ_HAVE_FEC_V10)
135add_subdirectory(afec)
136endif()
137if (RKAIQ_HAVE_GAMMA_V10 OR RKAIQ_HAVE_GAMMA_V11)
138add_subdirectory(agamma)
139endif()
140if (RKAIQ_HAVE_DEGAMMA_V1)
141add_subdirectory(adegamma)
142endif()
143if (RKAIQ_HAVE_GIC_V1 OR RKAIQ_HAVE_GIC_V2)
144add_subdirectory(agic)
145endif()
146if (RKAIQ_HAVE_LDCH_V10 OR RKAIQ_HAVE_LDCH_V21)
147add_subdirectory(aldch)
148endif()
149if (RKAIQ_HAVE_LSC_V1 OR RKAIQ_HAVE_LSC_V2 OR RKAIQ_HAVE_LSC_V3)
150add_subdirectory(alsc)
151endif()
152if (RKAIQ_HAVE_ORB_V1)
153add_subdirectory(aorb)
154endif()
155if (RKAIQ_HAVE_CSM_V1)
156add_subdirectory(acsm)
157endif()
158if (RKAIQ_HAVE_WDR_V1)
159add_subdirectory(awdr)
160endif()
161if (RKAIQ_HAVE_SHARP_V3)
162add_subdirectory(asharp3)
163endif()
164if (RKAIQ_HAVE_YNR_V2)
165add_subdirectory(aynr2)
166endif()
167if (RKAIQ_HAVE_CNR_V1)
168add_subdirectory(acnr)
169endif()
170if (RKAIQ_HAVE_BAYERNR_V2)
171add_subdirectory(arawnr2)
172endif()
173if (RKAIQ_HAVE_EIS_V1)
174add_subdirectory(aeis)
175endif()
176if (RKAIQ_HAVE_AMD_V1)
177add_subdirectory(amd)
178endif()
179if (RKAIQ_HAVE_BAYERNR_V1)
180add_subdirectory(arawnr)
181endif()
182if (RKAIQ_HAVE_YNR_V1)
183add_subdirectory(aynr)
184endif()
185if (RKAIQ_HAVE_UVNR_V1)
186add_subdirectory(auvnr)
187endif()
188if (RKAIQ_HAVE_MFNR_V1)
189add_subdirectory(amfnr)
190endif()
191if (RKAIQ_HAVE_GAIN_V1)
192add_subdirectory(again)
193endif()
194if (RKAIQ_HAVE_GAIN_V2)
195add_subdirectory(again2)
196endif()
197if (RKAIQ_HAVE_YNR_V3)
198add_subdirectory(aynr3)
199endif()
200if (RKAIQ_HAVE_YNR_V22)
201add_subdirectory(aynrV22)
202endif()
203if (RKAIQ_HAVE_CNR_V2)
204add_subdirectory(acnr2)
205endif()
206if (RKAIQ_HAVE_SHARP_V4)
207add_subdirectory(asharp4)
208endif()
209if (RKAIQ_HAVE_SHARP_V33 OR RKAIQ_HAVE_SHARP_V33_LITE)
210add_subdirectory(asharpV33)
211endif()
212if (RKAIQ_HAVE_BAYER2DNR_V2)
213add_subdirectory(abayer2dnr2)
214endif()
215if (RKAIQ_HAVE_BAYER2DNR_V23)
216add_subdirectory(abayer2dnrV23)
217endif()
218if (RKAIQ_HAVE_BAYERTNR_V2)
219add_subdirectory(abayertnr2)
220endif()
221if (RKAIQ_HAVE_BAYERTNR_V23 OR RKAIQ_HAVE_BAYERTNR_V23_LITE)
222add_subdirectory(abayertnrV23)
223endif()
224if (RKAIQ_HAVE_CNR_V30 OR RKAIQ_HAVE_CNR_V30_LITE)
225add_subdirectory(acnrV30)
226endif()
227if (RKAIQ_HAVE_CAC_V03 OR RKAIQ_HAVE_CAC_V10 OR RKAIQ_HAVE_CAC_V11)
228add_subdirectory(acac)
229endif()
230if (RKAIQ_HAVE_DPCC_V1)
231add_subdirectory(adpcc)
232endif()
233