summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 265f1597120139a05c5c5b23901811f0fd370830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT("mediahub" C)

INCLUDE(FindPkgConfig)
pkg_check_modules(PKGS REQUIRED
		glib-2.0
		elementary
		capi-appfw-application
		legacy-capi-media-player
		capi-ui-efl-util
		app-utils)

IF(NOT DEFINED PACKAGE_NAME)
	SET(PACKAGE_NAME "org.tizen.mediahub")
ENDIF(NOT DEFINED PACKAGE_NAME)

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
IF(NOT DEFINED BINDIR)
	SET(BINDIR "${PREFIX}/bin")
ENDIF(NOT DEFINED BINDIR)
IF(NOT DEFINED RESDIR)
  SET(RESDIR "${PREFIX}/res")
ENDIF(NOT DEFINED RESDIR)
IF(NOT DEFINED EDJEDIR)
	SET(EDJEDIR "${PREFIX}/res/edje")
ENDIF(NOT DEFINED EDJEDIR)
IF(NOT DEFINED LOCALEDIR)
	SET(LOCALEDIR "${PREFIX}/res/locale")
ENDIF(NOT DEFINED LOCALEDIR)
IF(NOT DEFINED IMAGEDIR)
  SET(IMAGEDIR "${PREFIX}/res/images")
ENDIF(NOT DEFINED IMAGEDIR)
IF(NOT DEFINED PACKAGEDIR)
	SET(PACKAGEDIR "/usr/share/packages")
ENDIF(NOT DEFINED PACKAGEDIR)
IF(NOT DEFINED DESKTOP_ICONDIR)
	SET(DESKTOP_ICONDIR "/usr/share/icons")
ENDIF(NOT DEFINED DESKTOP_ICONDIR)
IF(NOT DEFINED DESKTOP_ICON)
	SET(DESKTOP_ICON ${PACKAGE_NAME}.png)
ENDIF(NOT DEFINED DESKTOP_ICON)

SET(SRCS
src/main.c
src/view/base.c
src/view/viewer.c
src/view/mplayer.c
src/view/action_menu.c
src/layout/movie.c
src/layout/gallery.c
src/layout/music.c
src/util/controller.c
src/util/listmgr.c
src/util/timeout_handler.c
src/util/util.c
src/util/playermgr.c
src/util/progressbar.c
src/data/mediadata.c
)

SET(TARGET_EDJ "${PROJECT_NAME}.edj")
SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")

ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)

ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})

FOREACH(flag ${PKGS_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR})
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR})
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
ADD_SUBDIRECTORY(res/edc)