1 # Copyright (c) 2014 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)
17 PROJECT("homescreen-tv-ref" C)
19 IF(NOT DEFINED PACKAGE_NAME)
20 SET(PACKAGE_NAME "org.tizen.homescreen-tv-ref")
21 ENDIF(NOT DEFINED PACKAGE_NAME)
23 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
24 IF(NOT DEFINED BINDIR)
25 SET(BINDIR"${PREFIX}/bin")
26 ENDIF(NOT DEFINED BINDIR)
27 IF(NOT DEFINED IMAGEDIR)
28 SET(IMAGEDIR "${PREFIX}/res/images")
29 ENDIF(NOT DEFINED IMAGEDIR)
30 IF(NOT DEFINED CFGDIR)
31 SET(CFGDIR "${PREFIX}/res/config")
32 ENDIF(NOT DEFINED CFGDIR)
33 IF(NOT DEFINED LOCALEDIR)
34 SET(LOCALEDIR "${PREFIX}/res/locale")
35 ENDIF(NOT DEFINED LOCALEDIR)
36 IF(NOT DEFINED MANIFESTDIR)
37 SET(MANIFESTDIR "/usr/share/packages")
38 ENDIF(NOT DEFINED MANIFESTDIR)
40 SET(TARGET_EDJ "${PROJECT_NAME}.edj")
41 SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
42 SET(DEF_CONFIG "${PROJECT_NAME}.json")
54 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
55 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
56 ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
57 ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
58 ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
59 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
60 ADD_DEFINITIONS("-DDEF_CONFIG=\"${CFGDIR}/${DEF_CONFIG}\"")
62 INCLUDE(FindPkgConfig)
63 pkg_check_modules(PKGS REQUIRED
74 capi-appfw-application)
76 FOREACH(flag ${PKGS_CFLAGS})
77 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
80 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
81 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
82 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
83 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
85 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
86 INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
87 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png")
89 ADD_SUBDIRECTORY(edje)
90 ADD_SUBDIRECTORY(config)