Update camera by the splited muse library
[platform/core/api/camera.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 # project
4 SET(project_prefix "capi")
5 SET(prefix "/usr")
6 SET(maintainer "Jeongmo Yang<jm80.yang@samsung.com>, Hyuntae Kim<ht1211.kim@samsung.com>, Seokhoon Lee<andy.shlee@samsung.com>, Taeyoung Chung <ty83.chung@samsung.com>, Sejong Park<sejong123.park@samsung.com, Haesu Gwon<haesu.gwon@samsung.com")
7 SET(description "A Camera library in Tizen Native API")
8 SET(service "media")
9 SET(submodule "camera")
10
11 # for package file
12 IF(TIZEN_FEATURE_EVAS_RENDERER)
13 SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client mm-evas-renderer muse-client")
14 ELSE(TIZEN_FEATURE_EVAS_RENDERER)
15 SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client muse-client")
16 ENDIF(TIZEN_FEATURE_EVAS_RENDERER)
17 SET(pc_dependents "capi-base-common capi-media-tool libtbm evas ecore elementary")
18 SET(fw_name "${project_prefix}-${service}-${submodule}")
19
20 PROJECT(${fw_name})
21
22 SET(CMAKE_INSTALL_PREFIX ${prefix})
23 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
24
25 SET(INC_DIR include)
26 INCLUDE_DIRECTORIES(${INC_DIR})
27
28 INCLUDE(FindPkgConfig)
29 pkg_check_modules(${fw_name} REQUIRED ${dependents})
30 FOREACH(flag ${${fw_name}_CFLAGS})
31     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
32 ENDFOREACH(flag)
33
34 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
35 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
36
37 IF("${ARCH}" STREQUAL "arm")
38     ADD_DEFINITIONS("-DTARGET")
39 ENDIF("${ARCH}" STREQUAL "arm")
40
41 IF(TIZEN_FEATURE_EVAS_RENDERER)
42     ADD_DEFINITIONS("-DTIZEN_FEATURE_EVAS_RENDERER")
43 ENDIF(TIZEN_FEATURE_EVAS_RENDERER)
44
45 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
46 ADD_DEFINITIONS("-DTIZEN_DEBUG")
47
48 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
49
50 aux_source_directory(src SOURCES)
51 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
52
53 SET_TARGET_PROPERTIES(${fw_name}
54      PROPERTIES
55      VERSION ${FULLVER}
56      SOVERSION ${MAJORVER}
57      CLEAN_DIRECT_OUTPUT 1
58 )
59
60 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
61
62 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
63 INSTALL(
64         DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
65         FILES_MATCHING
66         PATTERN "*_private.h" EXCLUDE
67         PATTERN "${INC_DIR}/*.h"
68         )
69
70 SET(PC_NAME ${fw_name})
71 SET(PC_REQUIRED ${pc_dependents})
72 SET(PC_LDFLAGS -l${fw_name})
73
74 CONFIGURE_FILE(
75     ${fw_name}.pc.in
76     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
77     @ONLY
78 )
79 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
80
81 IF(TIZEN_FEATURE_TESTSUITE)
82 ADD_SUBDIRECTORY(test)
83 ENDIF(TIZEN_FEATURE_TESTSUITE)
84
85 IF(UNIX)
86
87 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
88 ADD_CUSTOM_COMMAND(
89         DEPENDS clean
90         COMMENT "distribution clean"
91         COMMAND find
92         ARGS    .
93         -not -name config.cmake -and \(
94         -name tester.c -or
95         -name Testing -or
96         -name CMakeFiles -or
97         -name cmake.depends -or
98         -name cmake.check_depends -or
99         -name CMakeCache.txt -or
100         -name cmake.check_cache -or
101         -name *.cmake -or
102         -name Makefile -or
103         -name core -or
104         -name core.* -or
105         -name gmon.out -or
106         -name install_manifest.txt -or
107         -name *.pc -or
108         -name *~ \)
109         | grep -v TC | xargs rm -rf
110         TARGET  distclean
111         VERBATIM
112 )
113
114 ENDIF(UNIX)