1 # Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
19 INCLUDE(FindPkgConfig)
20 pkg_check_modules(PKGS REQUIRED
23 capi-appfw-application
27 IF(NOT DEFINED PACKAGE_NAME)
28 SET(PACKAGE_NAME "org.tizen.mediahub")
29 ENDIF(NOT DEFINED PACKAGE_NAME)
31 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
32 IF(NOT DEFINED BINDIR)
33 SET(BINDIR "${PREFIX}/bin")
34 ENDIF(NOT DEFINED BINDIR)
35 IF(NOT DEFINED RESDIR)
36 SET(RESDIR "${PREFIX}/res")
37 ENDIF(NOT DEFINED RESDIR)
38 IF(NOT DEFINED EDJEDIR)
39 SET(EDJEDIR "${PREFIX}/res/edje")
40 ENDIF(NOT DEFINED EDJEDIR)
41 IF(NOT DEFINED LOCALEDIR)
42 SET(LOCALEDIR "${PREFIX}/res/locale")
43 ENDIF(NOT DEFINED LOCALEDIR)
44 IF(NOT DEFINED IMAGEDIR)
45 SET(IMAGEDIR "${PREFIX}/res/images")
46 ENDIF(NOT DEFINED IMAGEDIR)
47 IF(NOT DEFINED PACKAGEDIR)
48 SET(PACKAGEDIR "/usr/share/packages")
49 ENDIF(NOT DEFINED PACKAGEDIR)
61 src/util/timeout_handler.c
64 src/util/progressbar.c
68 SET(TARGET_EDJ "${PROJECT_NAME}.edj")
69 SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
71 ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
72 ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
73 ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
74 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
75 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
76 ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
77 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
79 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
81 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
83 FOREACH(flag ${PKGS_CFLAGS})
84 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
86 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
88 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
89 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
91 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
92 INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR})
93 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
94 ADD_SUBDIRECTORY(res/edc)