1 INCLUDE( common.cmake )
4 # OPTION, VARIABLE, LIST_OF_VALUES, DESCRIPTION
5 ARG_ENABLE( ENABLE_EXPORTALL enable_exportall 1 "Enables the exporting of all the symbols in the library" )
6 ARG_ENABLE( ENABLE_DEBUG enable_debug ${ENABLE_VAL} "Turns on debugging" )
7 ARG_ENABLE( ENABLE_SHADERBINCACHE enable_shaderbincache ${ENABLE_VAL} "Enables shader binary cache" )
8 ARG_ENABLE( ENABLE_NETWORKLOGGING enable_networklogging ${ENABLE_VAL} "Enables network for debug tool" )
10 # Currently, dali-adaptor requires appfw on Tizen
11 # and does not require it on Ubuntu.
12 # So we should be able to enable/disable this option for dali-adaptor.
13 ARG_ENABLE( ENABLE_APPFW enable_appfw ${ENABLE_VAL} "Builds with Tizen App framework libraries, off by default" )
15 # Tizen Profile option
16 ARG_ENABLE( ENABLE_PROFILE enable_profile "${ENABLE_VAL};UBUNTU" "Select the variant of tizen" )
19 ARG_ENABLE( ENABLE_TIZEN_MAJOR_VERSION enable_tizen_major_version "${ENABLE_VAL};0" "Specify the Tizen Major version for backwards compatibility" )
21 ARG_ENABLE( ENABLE_FEEDBACK enable_feedback 1 "Enable feedback plugin" )
23 ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" )
24 ARG_ENABLE( ENABLE_ECORE_WAYLAND2 enable_ecore_wayland2 "${ENABLE_VAL}" "Build on Ecore Wayland2" )
25 ARG_ENABLE( ENABLE_RENAME_SO enable_rename_so "${ENABLE_VAL};1" "Specify whether so file is renamed or not" )
26 ARG_ENABLE( ENABLE_COVERAGE enable_coverage "${ENABLE_VAL}" "Enables coverage" )
29 ARG_ENABLE( PRINT_HELP print_help "${ENABLE_VAL}" "Prints help" )
32 MESSAGE( STATUS ${HELP_ENABLES} )
36 IF( NOT enable_profile )
38 SET( enable_profile ANDROID )
40 SET( enable_profile UBUNTU )
44 # Test for profile and exit if something wrong
45 SET( VALID_PROFILES COMMON MOBILE WEARABLE TV IVI UBUNTU ANDROID WINDOWS )
46 LIST( FIND VALID_PROFILES ${enable_profile} RESULT )
48 MESSAGE( FATAL_ERROR "Invalid profile!" )
51 # Defines profile specific variable
52 SET( ${enable_profile}_PROFILE 1 )
54 # TODO check what version we really need for Android
56 SET( FREETYPE_REQUIRED 6.16.0 )
57 SET( FREETYPE_BITMAP_SUPPORT_VERSION 6.16.0 )
59 SET( FREETYPE_REQUIRED 9.16.3 )
60 SET( FREETYPE_BITMAP_SUPPORT_VERSION 17.1.11 )
63 SET( ELDBUS_REQUIRED 1.16.0 )
65 # checking all possibly used modules (required and optionals)
66 CHECK_MODULE_AND_SET( EXIF exif exif_available )
67 CHECK_MODULE_AND_SET( FREETYPE freetype2>=${FREETYPE_REQUIRED} freetype_available )
68 CHECK_MODULE_AND_SET( FREETYPE_BITMAP_SUPPORT freetype2>=${FREETYPE_BITMAP_SUPPORT_VERSION} freetype_bitmap_support)
69 CHECK_MODULE_AND_SET( FONTCONFIG fontconfig fontconfig_available )
70 CHECK_MODULE_AND_SET( PNG libpng [] )
71 CHECK_MODULE_AND_SET( WEBP libwebp webp_available )
72 CHECK_MODULE_AND_SET( WEBP_DEMUX libwebpdemux [] )
73 CHECK_MODULE_AND_SET( LIBEXIF libexif [] )
74 CHECK_MODULE_AND_SET( LIBDRM libdrm [] )
75 CHECK_MODULE_AND_SET( LIBCURL libcurl [] )
76 CHECK_MODULE_AND_SET( HARFBUZZ harfbuzz [] )
77 CHECK_MODULE_AND_SET( FRIBIDI fribidi [] )
78 CHECK_MODULE_AND_SET( CAIRO cairo [] )
79 CHECK_MODULE_AND_SET( EVAS evas [] )
80 CHECK_MODULE_AND_SET( TTRACE ttrace ENABLE_TTRACE )
81 CHECK_MODULE_AND_SET( ECORE ecore [] )
82 CHECK_MODULE_AND_SET( ECORE_IPC ecore-ipc [] )
83 CHECK_MODULE_AND_SET( ECORE_IMF ecore-imf [] )
84 CHECK_MODULE_AND_SET( ELDBUS eldbus>=${ELDBUS_REQUIRED} eldbus_available )
85 CHECK_MODULE_AND_SET( TPKP_CURL tpkp-curl tpkp_curl_available )
86 CHECK_MODULE_AND_SET( UTILX utilX utilx_available )
87 CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
88 CHECK_MODULE_AND_SET( EGL egl [] )
89 CHECK_MODULE_AND_SET( DLOG dlog [] )
90 CHECK_MODULE_AND_SET( TTS tts [] )
91 CHECK_MODULE_AND_SET( VCONF vconf [] )
93 CHECK_MODULE_AND_SET( CAPI_SYSTEM_INFO capi-system-info [] )
94 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SENSOR capi-system-sensor capi_system_sensor_support )
95 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SYSTEM_SETTINGS capi-system-system-settings [] )
96 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION capi-appfw-application [] )
97 CHECK_MODULE_AND_SET( COMPONENT_BASED_CORE_BASE component-based-core-base [] )
99 CHECK_MODULE_AND_SET( ELEMENTARY elementary [] )
100 CHECK_MODULE_AND_SET( BUNDLE bundle [] )
101 CHECK_MODULE_AND_SET( SCREENCONNECTORPROVIDER screen_connector_provider [] )
102 CHECK_MODULE_AND_SET( APPFW_WATCH capi-appfw-watch-application watch_available )
103 CHECK_MODULE_AND_SET( APPCORE_WATCH appcore-watch [] )
105 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION appcore-ui [] )
106 CHECK_MODULE_AND_SET( CAPI_APPFW_WIDGET_BASE appcore-widget-base [] )
107 CHECK_MODULE_AND_SET( CAPI_APPFW_COMMON capi-appfw-app-common [] )
108 CHECK_MODULE_AND_SET( CAPI_APPFW_CONTROL capi-appfw-app-control [] )
110 CHECK_MODULE_AND_SET( DALICORE dali2-core [] )
112 IF( ANDROID_PROFILE )
113 INCLUDE_DIRECTORIES( ${ANDROID_NDK} )
114 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources )
115 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android )
116 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android/native_app_glue )
117 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr )
118 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr/include/android )
122 IF( enable_ecore_wayland2 )
123 PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
125 PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
129 CHECK_MODULE_AND_SET( ECORE_X ecore-x DALI_USE_ECORE_X11 [] )
130 CHECK_MODULE_AND_SET( X11 x11 DALI_USE_X11 [] )
133 CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] )
136 IF( watch_available AND WEARABLE_PROFILE )
137 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
140 IF( eldbus_available )
141 SET(DALI_ELDBUS_AVAILABLE 1)
142 ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
146 SET(DALI_WEBP_AVAILABLE 1)
147 ADD_DEFINITIONS( -DDALI_WEBP_AVAILABLE )
150 ADD_DEFINITIONS( -DPLATFORM_TIZEN )
153 ADD_DEFINITIONS( -DDEBUG_ENABLED )
154 SET( ENABLE_EXPORTALL ON )
157 IF( NOT ${ENABLE_EXPORTALL} )
158 ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
161 IF( enable_shaderbincache )
162 ADD_DEFINITIONS( -DSHADERBIN_CACHE_ENABLED )
165 IF( enable_networklogging )
166 ADD_DEFINITIONS( -DNETWORK_LOGGING_ENABLED )
169 IF( watch_available AND WEARABLE_PROFILE )
170 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
173 IF( capi_system_sensor_support AND (NOT UBUNTU_PROFILE) )
174 ADD_DEFINITIONS( -DCAPI_SYSTEM_SENSOR_SUPPORT )
177 IF( enable_appfw AND (enable_tizen_major_version EQUAL 3) )
178 ADD_DEFINITIONS( -DWIDGET_AVAILABLE )
181 IF( enable_wayland AND (NOT COMMON_PROFILE) )
182 PKG_CHECK_MODULES( WAYLAND_EXTENSION [xdg-shell-client text-client input-method-client] )
185 IF( freetype_bitmap_support )
186 ADD_DEFINITIONS( -DFREETYPE_BITMAP_SUPPORT )
189 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
190 ADD_COMPILE_OPTIONS( --coverage )
191 SET(ENABLE_COVERAGE ON)
192 SET(COVERAGE --coverage)
195 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
196 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
198 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
201 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
202 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
204 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
207 IF( DEFINED ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
208 SET( tizenPlatformConfigSupported $ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
209 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "YES" )
211 SET( tizenPlatformConfigSupported 0 )
212 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "NO" )
215 IF( DEFINED ENV{FONT_CONFIGURATION_FILE} )
216 SET( fontConfigurationFile $ENV{FONT_CONFIGURATION_FILE} )
220 SET( cachePath $ENV{HOME} )
222 SET( cachePath /home/owner )
226 ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
229 #######################################################
231 ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
232 SET( DALI_PROFILE_CFLAGS -DDALI_PROFILE_${enable_profile} )
234 # Platforms with highp shader support can use vector based text
235 ADD_DEFINITIONS( "-DENABLE_VECTOR_BASED_TEXT_RENDERING" )
237 CONDITIONAL( WAYLAND enable_wayland )
239 # set lowercase profile name
240 STRING( TOLOWER ${ENABLE_PROFILE} PROFILE_LCASE )
242 ##########################################################3
243 # Default CFLAGS of packages
246 ${DALI_ADAPTOR_CFLAGS}
260 ${CAPI_SYSTEM_SENSOR_CFLAGS}
268 # Default set of linked librarires
271 ${OPENGLES20_LDFLAGS}
273 ${FONTCONFIG_LDFLAGS}
277 ${WEBP_DEMUX_LDFLAGS}
282 ${CAPI_SYSTEM_SENSOR_LDFLAGS}
294 # Android includes pthread with android lib
295 if( NOT ANDROID_PROFILE )
296 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
301 # You need to include manually private and Android libs deps in order to link for Android
302 IF( ANDROID_PROFILE )
303 CHECK_MODULE_AND_SET( PIXMAN pixman-1 [] )
304 CHECK_MODULE_AND_SET( EXPAT expat [] )
306 SET( DALI_CFLAGS ${DALI_CFLAGS}
312 LIST( APPEND DALI_LDFLAGS
326 # EVAS used indicator
327 SET( DALI_CFLAGS ${DALI_CFLAGS}
334 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
341 SET( DALI_CFLAGS ${DALI_CFLAGS}
342 ${CAPI_APPFW_APPLICATION_CFLAGS}
343 ${CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS}
344 ${CAPI_SYSTEM_INFO_CFLAGS}
348 ${CAPI_APPFW_COMMON_CFLAGS}
349 ${CAPI_APPFW_CONTROL_CFLAGS}
350 ${CAPI_APPFW_WIDGET_BASE_CFLAGS}
353 ${COMPONENT_BASED_CORE_BASE_CFLAGS}
356 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
357 ${CAPI_APPFW_APPLICATION_LDFLAGS}
358 ${CAPI_SYSTEM_SYSTEM_SETTINGS_LDFLAGS}
359 ${CAPI_SYSTEM_INFO_LDFLAGS}
363 ${CAPI_APPFW_COMMON_LDFLAGS}
364 ${CAPI_APPFW_CONTROL_LDFLAGS}
365 ${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
368 ${COMPONENT_BASED_CORE_BASE_LDFLAGS}
371 SET( DALI_CFLAGS ${DALI_CFLAGS}
375 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
376 ${ELEMENTARY_LDFLAGS}
382 SET( DALI_CFLAGS ${DALI_CFLAGS}
386 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
390 SET( DALI_CFLAGS ${DALI_CFLAGS}
393 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
401 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
406 SET( DALI_CFLAGS ${DALI_CFLAGS}
409 ${NATIVE_BUFFER_CFLAGS}
410 ${NATIVE_BUFFER_POOL_CFLAGS}
413 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
414 ${EFL_ASSIST_LDFLAGS}
415 ${NATIVE_BUFFER_LDFLAGS}
416 ${NATIVE_BUFFER_POOL_LDFLAGS}
421 IF( WEARABLE_PROFILE )
422 SET( DALI_CFLAGS ${DALI_CFLAGS}
425 ${SCREENCONNECTORPROVIDER_CFLAGS}
426 ${APPCORE_WATCH_CFLAGS}
428 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
429 ${SCREENCONNECTORPROVIDER_LDFLAGS}
430 ${APPCORE_WATCH_LDFLAGS}
436 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
441 SET( DALI_CFLAGS ${DALI_CFLAGS}
444 ${NATIVE_BUFFER_CFLAGS}
445 ${NATIVE_BUFFER_POOL_CFLAGS}
447 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
448 ${EFL_ASSIST_LDFLAGS}
449 ${NATIVE_BUFFER_LDFLAGS}
450 ${NATIVE_BUFFER_POOL_LDFLAGS}
456 SET( DALI_CFLAGS ${DALI_CFLAGS} -fPIC )
457 SET( DALI_LDFLAGS ${DALI_LDFLAGS} -ljpeg )
460 IF( NOT COMMON_PROFILE )
461 ADD_DEFINITIONS( -DWAYLAND_EXTENSIONS_SUPPORTED )
464 # had to do it here for Android by some reason, even if it is set above already
465 IF( ANDROID_PROFILE )
466 SET( daliReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
467 SET( daliReadWriteDir $ENV{DALI_DATA_RW_DIR} )
470 SET( daliDefaultThemeDir ${dataReadWriteDir}/theme/ )
471 SET( fontPreloadedPath $ENV{FONT_PRELOADED_PATH} )
472 SET( fontDownloadedPath $ENV{FONT_DOWNLOADED_PATH} )
473 SET( fontApplicationPath $ENV{FONT_APPLICATION_PATH} )
476 ADD_DEFINITIONS( -DDALI_DATA_RW_DIR="${daliReadWriteDir}"
477 -DDALI_DATA_RO_DIR="${daliReadOnlyDir}"
478 -DDALI_DEFAULT_FONT_CACHE_DIR="${daliDefaultFontCacheDir}"
479 -DDALI_USER_FONT_CACHE_DIR="${daliUserFontCacheDir}"
480 -DDALI_SHADERBIN_DIR="${daliShaderbinCacheDir}"
481 -DDALI_DEFAULT_THEME_DIR="${daliDefaultThemeDir}"
482 -DFONT_PRELOADED_PATH="${fontPreloadedPath}"
483 -DFONT_DOWNLOADED_PATH="${fontDownloadedPath}"
484 -DFONT_APPLICATION_PATH="${fontApplicationPath}"
485 -DFONT_CONFIGURATION_FILE="${fontConfigurationFile}"
486 -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported}