base: adjust the height of play info content
[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                 elementary
22                 capi-appfw-application
23                 capi-media-player
24                 app-utils)
25
26 IF(NOT DEFINED PACKAGE_NAME)
27         SET(PACKAGE_NAME "org.tizen.mediahub")
28 ENDIF(NOT DEFINED PACKAGE_NAME)
29
30 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
31 IF(NOT DEFINED BINDIR)
32         SET(BINDIR "${PREFIX}/bin")
33 ENDIF(NOT DEFINED BINDIR)
34 IF(NOT DEFINED RESDIR)
35   SET(RESDIR "${PREFIX}/res")
36 ENDIF(NOT DEFINED RESDIR)
37 IF(NOT DEFINED EDJEDIR)
38         SET(EDJEDIR "${PREFIX}/res/edje")
39 ENDIF(NOT DEFINED EDJEDIR)
40 IF(NOT DEFINED LOCALEDIR)
41         SET(LOCALEDIR "${PREFIX}/res/locale")
42 ENDIF(NOT DEFINED LOCALEDIR)
43 IF(NOT DEFINED IMAGEDIR)
44   SET(IMAGEDIR "${PREFIX}/res/images")
45 ENDIF(NOT DEFINED IMAGEDIR)
46 IF(NOT DEFINED PACKAGEDIR)
47         SET(PACKAGEDIR "/usr/share/packages")
48 ENDIF(NOT DEFINED PACKAGEDIR)
49
50 SET(SRCS
51 src/main.c
52 src/view/base.c
53 src/view/viewer.c
54 src/view/mplayer.c
55 src/layout/movie.c
56 src/layout/gallery.c
57 src/layout/music.c
58 src/util/controller.c
59 src/util/listmgr.c
60 src/util/timeout_handler.c
61 src/util/util.c
62 src/util/playermgr.c
63 src/util/progressbar.c
64 src/data/mediadata.c
65 )
66
67 SET(TARGET_EDJ "${PROJECT_NAME}.edj")
68 SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
69
70 ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
71 ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
72 ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
73 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
74 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
75 ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
76 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
77
78 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
79
80 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
81
82 FOREACH(flag ${PKGS_CFLAGS})
83         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
84 ENDFOREACH(flag)
85 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
86
87 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
88 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
89
90 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
91 INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR})
92 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
93 ADD_SUBDIRECTORY(res/edc)