base: show play info item when the app is launched
[profile/tv/apps/native/air_mediahub.git] / CMakeLists.txt
1 # Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15
16 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
17 PROJECT("mediahub" C)
18
19 INCLUDE(FindPkgConfig)
20 pkg_check_modules(PKGS REQUIRED
21                 glib-2.0
22                 elementary
23                 capi-appfw-application
24                 capi-media-player
25                 capi-ui-efl-util
26                 app-utils)
27
28 IF(NOT DEFINED PACKAGE_NAME)
29         SET(PACKAGE_NAME "org.tizen.mediahub")
30 ENDIF(NOT DEFINED PACKAGE_NAME)
31
32 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
33 IF(NOT DEFINED BINDIR)
34         SET(BINDIR "${PREFIX}/bin")
35 ENDIF(NOT DEFINED BINDIR)
36 IF(NOT DEFINED RESDIR)
37   SET(RESDIR "${PREFIX}/res")
38 ENDIF(NOT DEFINED RESDIR)
39 IF(NOT DEFINED EDJEDIR)
40         SET(EDJEDIR "${PREFIX}/res/edje")
41 ENDIF(NOT DEFINED EDJEDIR)
42 IF(NOT DEFINED LOCALEDIR)
43         SET(LOCALEDIR "${PREFIX}/res/locale")
44 ENDIF(NOT DEFINED LOCALEDIR)
45 IF(NOT DEFINED IMAGEDIR)
46   SET(IMAGEDIR "${PREFIX}/res/images")
47 ENDIF(NOT DEFINED IMAGEDIR)
48 IF(NOT DEFINED PACKAGEDIR)
49         SET(PACKAGEDIR "/usr/share/packages")
50 ENDIF(NOT DEFINED PACKAGEDIR)
51 IF(NOT DEFINED DESKTOP_ICONDIR)
52         SET(DESKTOP_ICONDIR "/usr/share/icons")
53 ENDIF(NOT DEFINED DESKTOP_ICONDIR)
54 IF(NOT DEFINED DESKTOP_ICON)
55         SET(DESKTOP_ICON ${PACKAGE_NAME}.png)
56 ENDIF(NOT DEFINED DESKTOP_ICON)
57
58 SET(SRCS
59 src/main.c
60 src/view/base.c
61 src/view/viewer.c
62 src/view/mplayer.c
63 src/layout/movie.c
64 src/layout/gallery.c
65 src/layout/music.c
66 src/util/controller.c
67 src/util/listmgr.c
68 src/util/timeout_handler.c
69 src/util/util.c
70 src/util/playermgr.c
71 src/util/progressbar.c
72 src/data/mediadata.c
73 )
74
75 SET(TARGET_EDJ "${PROJECT_NAME}.edj")
76 SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
77
78 ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
79 ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
80 ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
81 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
82 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
83 ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
84 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
85
86 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
87
88 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
89
90 FOREACH(flag ${PKGS_CFLAGS})
91         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
92 ENDFOREACH(flag)
93 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
94
95 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
96 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
97
98 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
99 INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR})
100 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
101 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR})
102 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
103 ADD_SUBDIRECTORY(res/edc)