# 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("home" C) IF(NOT DEFINED PACKAGE_NAME) SET(PACKAGE_NAME "org.tizen.home") 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 IMAGEDIR) SET(IMAGEDIR "${PREFIX}/res/images") ENDIF(NOT DEFINED IMAGEDIR) IF(NOT DEFINED CFGDIR) SET(CFGDIR "${PREFIX}/res/config") ENDIF(NOT DEFINED CFGDIR) IF(NOT DEFINED LOCALEDIR) SET(LOCALEDIR "${PREFIX}/res/locale") ENDIF(NOT DEFINED LOCALEDIR) IF(NOT DEFINED MANIFESTDIR) SET(MANIFESTDIR "/usr/share/packages") ENDIF(NOT DEFINED MANIFESTDIR) SET(TARGET_EDJ "${PROJECT_NAME}.edj") SET(DEFCONFIG "${PROJECT_NAME}.json") SET(THEME_EDJ "${PROJECT_NAME}-theme.edj") SET(SRCS src/main.c src/utils.c src/data/datamgr.c src/data/data_home.c src/data/data_recent.c src/data/data_user.c src/data/data_photo.c src/view/view_photo.c src/view/view_user_edit.c src/view/view_user.c src/view/view_recent.c src/view/view_home.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"") ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"") ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"") ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"") ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"") ADD_DEFINITIONS("-DDEFCONFIG=\"${CFGDIR}/${DEFCONFIG}\"") INCLUDE(FindPkgConfig) pkg_check_modules(PKGS REQUIRED elementary json-glib-1.0 gio-2.0 libgum app-utils pkgmgr-info notification tv-service ecore-wayland capi-appfw-application) FOREACH(flag ${PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) 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 ${MANIFESTDIR}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png") ADD_SUBDIRECTORY(edje) ADD_SUBDIRECTORY(config)