[3.0] Updated internationalized strings
[platform/core/uifw/dali-demo.git] / build / tizen / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(dali-demo C CXX)
3
4 SET(dali-demo_VERSION_MAJOR 1)
5 SET(dali-demo_VERSION_MINOR 0)
6
7 SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
8
9 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
10
11 IF(DEFINED DALI_APP_DIR)
12         SET(APP_DATA_DIR ${DALI_APP_DIR})
13         SET(BINDIR ${APP_DATA_DIR}/bin)
14 ELSE()
15         SET(APP_DATA_DIR ${PREFIX}/share/com.samsung.dali-demo)
16         SET(BINDIR ${PREFIX}/bin)
17 ENDIF()
18
19 MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
20 if(CMAKE_BUILD_TYPE MATCHES Debug)
21     MESSAGE("Setting variable: DEBUG_ENABLED")
22     SET(DEBUG_ENABLED "1")
23 ENDIF()
24
25 SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources)
26 SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images)
27 SET(LOCAL_VIDEOS_DIR ${RESOURCE_DIR}/videos)
28 SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models)
29 SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts)
30 IF(NOT DEFINED LOCAL_STYLE_DIR)
31         SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style)
32 ENDIF()
33
34 SET(IMAGES_DIR ${APP_DATA_DIR}/images/)
35 SET(VIDEOS_DIR ${APP_DATA_DIR}/videos/)
36 SET(MODELS_DIR ${APP_DATA_DIR}/models/)
37 SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/)
38 SET(STYLE_DIR ${APP_DATA_DIR}/style/)
39
40 IF(NOT DEFINED LOCALE_DIR)
41         SET(LOCALE_DIR ${PREFIX}/share/locale)
42 ENDIF()
43
44 SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\")
45 SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\")
46 SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\")
47 SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\")
48 SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\")
49 SET(DEMO_THEME_PATH \\"${STYLE_DIR}/demo-theme.json\\")
50 SET(DEMO_EXAMPLE_BIN \\"${BINDIR}/\\")
51 SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\")
52 SET(DEMO_LANG \\"${LANG}\\")
53
54 FILE(GLOB LOCAL_IMAGES_PNG RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png")
55 FILE(GLOB LOCAL_IMAGES_JPG RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg")
56 FILE(GLOB LOCAL_IMAGES_GIF RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif")
57 FILE(GLOB LOCAL_IMAGES_BMP RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.bmp")
58 FILE(GLOB LOCAL_IMAGES_ICO RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ico")
59 FILE(GLOB LOCAL_IMAGES_WBMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.wbmp")
60 FILE(GLOB LOCAL_IMAGES_KTX RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ktx")
61 FILE(GLOB LOCAL_IMAGES_ASTC RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.astc")
62 FILE(GLOB LOCAL_IMAGES_SVG RELATIVE  "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.svg")
63
64 SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP};${LOCAL_IMAGES_KTX};${LOCAL_IMAGES_ASTC};${LOCAL_IMAGES_SVG})
65 FOREACH(flag ${LOCAL_IMAGES_LIST})
66         INSTALL(FILES ${LOCAL_IMAGES_DIR}/${flag} DESTINATION ${IMAGES_DIR})
67 ENDFOREACH(flag)
68
69 FILE(GLOB LOCAL_VIDEOS_LIST RELATIVE "${LOCAL_VIDEOS_DIR}" "${LOCAL_VIDEOS_DIR}/*")
70 FOREACH(flag ${LOCAL_VIDEOS_LIST})
71         INSTALL(FILES ${LOCAL_VIDEOS_DIR}/${flag} DESTINATION ${VIDEOS_DIR})
72 ENDFOREACH(flag)
73
74 FILE(GLOB LOCAL_MODELS_LIST RELATIVE "${LOCAL_MODELS_DIR}" "${LOCAL_MODELS_DIR}/*")
75 FOREACH(flag ${LOCAL_MODELS_LIST})
76         INSTALL(FILES ${LOCAL_MODELS_DIR}/${flag} DESTINATION ${MODELS_DIR})
77 ENDFOREACH(flag)
78
79 FILE(GLOB LOCAL_SCRIPTS_LIST RELATIVE "${LOCAL_SCRIPTS_DIR}" "${LOCAL_SCRIPTS_DIR}/*.json")
80 FOREACH(flag ${LOCAL_SCRIPTS_LIST})
81         INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/${flag} DESTINATION ${SCRIPTS_DIR})
82 ENDFOREACH(flag)
83
84 #Replace @DEMO_STYLE_IMAGE_DIR@ in following files
85 SET(DEMO_STYLE_IMAGE_DIR ${IMAGES_DIR})
86 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/demo-theme.json.in ${LOCAL_STYLE_DIR}/demo-theme.json )
87 INSTALL(FILES ${LOCAL_STYLE_DIR}/demo-theme.json DESTINATION ${STYLE_DIR})
88 CONFIGURE_FILE( ${LOCAL_SCRIPTS_DIR}/simple-image-wall.js.in ${LOCAL_SCRIPTS_DIR}/simple-image-wall.js )
89 INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/simple-image-wall.js DESTINATION ${SCRIPTS_DIR})
90
91 SET(PKG_LIST dali-core
92              dali-adaptor
93              dali-toolkit )
94
95 INCLUDE(FindPkgConfig)
96 pkg_check_modules(REQUIRED_PKGS REQUIRED ${PKG_LIST})
97
98 FOREACH(flag ${REQUIRED_PKGS_CFLAGS})
99         SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}")
100 ENDFOREACH(flag)
101
102 SET(DALI_DEMO_CFLAGS "-DDEMO_IMAGE_DIR=${DEMO_IMAGE_DIR} -DDEMO_VIDEO_DIR=${DEMO_VIDEO_DIR} -DDEMO_MODEL_DIR=${DEMO_MODEL_DIR} -DDEMO_SCRIPT_DIR=${DEMO_SCRIPT_DIR} -DDEMO_THEME_PATH=${DEMO_THEME_PATH} -DDEMO_EXAMPLE_BIN=${DEMO_EXAMPLE_BIN} -DDEMO_LOCALE_DIR=${DEMO_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDEMO_LANG=${DEMO_LANG}")
103
104 OPTION(INTERNATIONALIZATION "Internationalization demo string names" ON)
105 IF (INTERNATIONALIZATION)
106         SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -DINTERNATIONALIZATION_ENABLED")
107 ENDIF(INTERNATIONALIZATION)
108
109 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE")
110 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
111
112 INCLUDE_DIRECTORIES(${ROOT_SRC_DIR})
113 INCLUDE_DIRECTORIES(${DEMO_SRC_DIR})
114
115 ADD_SUBDIRECTORY(demo)
116 ADD_SUBDIRECTORY(examples)
117 ADD_SUBDIRECTORY(builder)