Updating INI configuration file to work with most cameras.
[profile/ivi/camera.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(camera C CXX)
3
4 message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
5 message("furcate arm or i686")
6 EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION)
7 message("This package is building by ${CMAKE_SYSTEM_VERSION}")
8 message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
9
10 SET(SRCS
11 src/cam.c
12 src/camera_utils.c
13 src/cam_mm.c
14 src/cam_app.c
15 src/cam_sound.c
16 src/cam_debug.c
17 src/cam_config.c
18 src/cam_file.c
19 src/cam_ta.c
20 src/cam_rec.c
21 src/cam_devman.c
22 src/cam_popup.c
23 src/cam_long_press.c
24 src/cam_ui_effect_utils.c
25 src/cam_ui_rotate_utils.c
26 src/cam_menu_composer.c
27 src/cam_typeconverter.cpp
28 src/cam_device_capacity.cpp
29 src/CamTypeConverter.cpp
30 src/CamDeviceCapacity.cpp
31 src/edc-callback/cam_common_edc_callback.c
32 src/edc-callback/cam_toolbar_edc_callback.c
33 src/edc-callback/cam_indicator_edc_callback.c
34 src/edc-callback/cam_zoom_edc_callback.c
35 src/edc-callback/cam_recording_edc_callback.c
36 )
37
38 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include
39 ${CMAKE_CURRENT_SOURCE_DIR}/include/edc-callback )
40
41 INCLUDE(FindPkgConfig)
42 pkg_check_modules(pkgs REQUIRED
43         elementary
44         devman
45         capi-appfw-application
46         capi-content-media-content
47         capi-location-manager
48         capi-media-camera
49         capi-media-image-util
50         capi-media-recorder
51         capi-media-sound-manager
52         capi-media-wav-player
53         capi-system-haptic
54         capi-system-power
55         gconf-2.0 vconf dlog ui-gadget-1
56         utilX
57         ecore-x ecore ecore-evas ecore-input eina
58         syspopup-caller
59 )
60 FOREACH(flag ${pkgs_CFLAGS})
61         SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
62 ENDFOREACH(flag)
63
64 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wall")
65 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC")
66 SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
67
68 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
69 SET(BINDIR "${PREFIX}/bin")
70 SET(RESDIR "${PREFIX}/res")
71 SET(DATADIR "${PREFIX}/data")
72 SET(LOCALEDIR "${RESDIR}/locale")
73 SET(ICONDIR "${RESDIR}/icons/default/small")
74 SET(EDJDIR "${RESDIR}/edje")
75 SET(IMAGEDIR "${RESDIR}/images")
76
77 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
78 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{PREFIX}\"")
79 ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
80 ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
81 ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
82 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGESDIR}\"")
83 ADD_DEFINITIONS("-DSLP_DEBUG")
84
85 if(NOT "${CMAKE_SYSTEM_VERSION}" MATCHES "^arm.*")
86 add_definitions(-DCAMERA_MACHINE_I686="${CMAKE_SYSTEM_VERSION}")
87 endif()
88
89 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
90
91 if("${CMAKE_SYSTEM_VERSION}" MATCHES "^arm.*")
92
93 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${EXTPkgs_LDFLAGS} "-pie")
94
95 else()
96 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
97 endif()
98 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
99
100 ###################################### EDC, Begin ################################
101 SET(EDC_DIR     ${CMAKE_SOURCE_DIR}/edc)
102 SET(IMAGE_DIR   ${CMAKE_SOURCE_DIR}/images)
103
104 SET(EDC_FILES
105 cam_main_layout
106 cam_toolbar_layout
107 cam_toolbar_layout_inverse
108 cam_toolbar_layout_vertical
109 cam_toolbar_layout_vertical_inverse
110 cam_recording_edje
111 cam_recording_edje_inverse
112 cam_recording_edje_vertical
113 cam_recording_edje_vertical_inverse
114 style_ctxpopup_camera_with_radio
115 style_ctxpopup_camera
116 style_slider_camera
117 cam_indicator_layout
118 cam_utils
119 cam_zoom_layout
120 cam_zoom_layout_inverse
121 cam_zoom_layout_vertical
122 cam_zoom_layout_vertical_inverse
123 cam_ctxpopup_shortcuts
124 cam_setting_popup_layout
125 )
126
127 FOREACH(file_name ${EDC_FILES})
128                 ADD_CUSTOM_TARGET(${file_name}.edj
129                                 COMMAND edje_cc -id ${IMAGE_DIR}
130                                 ${EDC_DIR}/${file_name}.edc ${EDC_DIR}/${file_name}.edj
131                                 DEPENDS ${EDC_DIR}/${file_name}.edc
132                 )
133                 ADD_DEPENDENCIES(${PROJECT_NAME} ${file_name}.edj)
134                 INSTALL(FILES ${EDC_DIR}/${file_name}.edj DESTINATION ${EDJDIR})
135 ENDFOREACH(file_name)
136
137 ###################################### EDC, end ################################
138
139
140 # install manifest file & icon
141 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.camera-app.xml DESTINATION /opt/share/packages/)
142 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.camera-app.png DESTINATION /opt/share/icons/default/small/)
143 INSTALL(FILES ${CMAKE_SOURCE_DIR}/ini/mmfw_camcorder.ini DESTINATION /usr/etc)
144 INSTALL(FILES ${CMAKE_SOURCE_DIR}/ini/mmfw_camcorder_dev_video_pri.ini DESTINATION /usr/etc)
145 INSTALL(FILES ${CMAKE_SOURCE_DIR}/ini/mmfw_camcorder_dev_video_sec.ini DESTINATION /usr/etc)
146 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/sounds DESTINATION ${RESDIR})
147 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/images DESTINATION ${RESDIR})
148
149 # install .camera.ini file
150 INSTALL(FILES ${CMAKE_SOURCE_DIR}/.camera.ini DESTINATION ${DATADIR})
151
152 # i18n
153 ADD_SUBDIRECTORY(po)
154