2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(fw_name "capi-media-vision")
7 SET(CMAKE_INSTALL_PREFIX /usr)
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
10 # Configure for porting layer:
12 option(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
13 "Turn on building of licensed port of the barcode detecting module (if OFF - open port will be built)." OFF)
14 option(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
15 "Turn on building of licensed port of the barcode generating module (if OFF - open port will be built)." OFF)
16 option(MEDIA_VISION_IMAGE_LICENSE_PORT
17 "Turn on building of licensed port of the image module (if OFF - open port will be built)." OFF)
18 option(MEDIA_VISION_FACE_LICENSE_PORT
19 "Turn on building of licensed port of the face module (if OFF - open port will be built)." OFF)
20 option(MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
21 "Turn on building of licensed port of the surveillance module (if OFF - open port will be built)." OFF)
23 set(MV_COMMON_LIB_NAME "mv_common")
24 set(MV_BARCODE_DETECTOR_LIB_NAME "mv_barcode_detector" CACHE STRING
25 "Name of the library will be built for barcode detecting module (without extension).")
26 set(MV_BARCODE_GENERATOR_LIB_NAME "mv_barcode_generator" CACHE STRING
27 "Name of the library will be built for barcode generating module (without extension).")
28 set(MV_IMAGE_LIB_NAME "mv_image" CACHE STRING
29 "Name of the library will be built for image module (without extension).")
30 set(MV_FACE_LIB_NAME "mv_face" CACHE STRING
31 "Name of the library will be built for barcode generating module (without extension).")
32 set(MV_SURVEILLANCE_LIB_NAME "mv_surveillance" CACHE STRING
33 "Name of the library will be built for surveillance module (without extension).")
36 SET(INC_DIR "${PROJECT_SOURCE_DIR}/include")
37 SET(INC_COMMON "${PROJECT_SOURCE_DIR}/mv_common/include")
39 message(STATUS "In_dir ${INC_DIR}")
41 if(MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT)
42 add_definitions(-DMEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT)
43 SET(INC_BARCODE_DETECTOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_detector_lic/include")
45 SET(INC_BARCODE_DETECTOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_detector/include")
48 if(MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT)
49 add_definitions(-DMEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT)
50 SET(INC_BARCODE_GENERATOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_generator_lic/include")
52 SET(INC_BARCODE_GENERATOR "${PROJECT_SOURCE_DIR}/mv_barcode/barcode_generator/include")
55 if(MEDIA_VISION_IMAGE_LICENSE_PORT)
56 add_definitions(-DMEDIA_VISION_IMAGE_LICENSE_PORT)
57 SET(INC_IMAGE "${PROJECT_SOURCE_DIR}/mv_image/image_lic/include")
59 SET(INC_IMAGE "${PROJECT_SOURCE_DIR}/mv_image/image/include")
62 if(MEDIA_VISION_FACE_LICENSE_PORT)
63 add_definitions(-DMEDIA_VISION_FACE_LICENSE_PORT)
64 SET(INC_FACE "${PROJECT_SOURCE_DIR}/mv_face/face_lic/include")
66 SET(INC_FACE "${PROJECT_SOURCE_DIR}/mv_face/face/include")
69 if(MEDIA_VISION_SURVEILLANCE_LICENSE_PORT)
70 add_definitions(-DMEDIA_VISION_SURVEILLANCE_LICENSE_PORT)
71 SET(INC_SURVEILLANCE "${PROJECT_SOURCE_DIR}/mv_surveillance/surveillance_lic/include")
73 SET(INC_SURVEILLANCE "${PROJECT_SOURCE_DIR}/mv_surveillance/surveillance/include")
76 INCLUDE_DIRECTORIES(${INC_DIR}
78 ${INC_BARCODE_DETECTOR}
79 ${INC_BARCODE_GENERATOR}
84 SET(dependents "dlog capi-media-tool capi-system-info")
85 SET(pc_dependents "dlog")
87 INCLUDE(FindPkgConfig)
88 pkg_check_modules(${fw_name} REQUIRED ${dependents})
89 FOREACH(flag ${${fw_name}_CFLAGS})
90 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
91 SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
94 SET(CMAKE_C_FLAGS "-I./include -I./include/headers ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -w")
95 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
97 SET(CMAKE_CXX_FLAGS "-I./include -I./include/headers ${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC")
98 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g --w")
100 IF("${ARCH}" STREQUAL "arm")
101 ADD_DEFINITIONS("-DTARGET")
102 ENDIF("${ARCH}" STREQUAL "arm")
104 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
105 ADD_DEFINITIONS("-DTIZEN_DEBUG")
107 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
109 ADD_SUBDIRECTORY(mv_common)
110 ADD_SUBDIRECTORY(mv_barcode)
111 ADD_SUBDIRECTORY(mv_image)
112 ADD_SUBDIRECTORY(mv_face)
113 ADD_SUBDIRECTORY(mv_surveillance)
115 aux_source_directory(src SOURCES)
116 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
118 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS}
119 ${MV_COMMON_LIB_NAME}
120 ${MV_BARCODE_DETECTOR_LIB_NAME}
121 ${MV_BARCODE_GENERATOR_LIB_NAME}
124 ${MV_SURVEILLANCE_LIB_NAME})
126 SET_TARGET_PROPERTIES(${fw_name}
129 SOVERSION ${MAJORVER}
130 CLEAN_DIRECT_OUTPUT 1
133 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
135 DIRECTORY ${INC_DIR}/ DESTINATION include/media
137 PATTERN "*_private.h" EXCLUDE
141 SET(PC_NAME ${fw_name})
142 SET(PC_REQUIRED ${pc_dependents})
143 SET(PC_LDFLAGS -l${fw_name})
144 SET(PC_CFLAGS -I\${includedir}/media)
148 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
151 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
153 ADD_SUBDIRECTORY(test)
157 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
160 COMMENT "distribution clean"
163 -not -name config.cmake -and \(
167 -name cmake.depends -or
168 -name cmake.check_depends -or
169 -name CMakeCache.txt -or
170 -name cmake.check_cache -or
176 -name install_manifest.txt -or
179 | grep -v TC | xargs rm -rf