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" )
22 ARG_ENABLE( ENABLE_TIZEN_MINOR_VERSION enable_tizen_minor_version "${ENABLE_VAL};0" "Specify the Tizen Minor version for backwards compatibility" )
24 ARG_ENABLE( ENABLE_FEEDBACK enable_feedback 1 "Enable feedback plugin" )
26 ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" )
27 ARG_ENABLE( ENABLE_ECORE_WAYLAND2 enable_ecore_wayland2 "${ENABLE_VAL}" "Build on Ecore Wayland2" )
28 ARG_ENABLE( ENABLE_RENAME_SO enable_rename_so "${ENABLE_VAL};1" "Specify whether so file is renamed or not" )
29 ARG_ENABLE( ENABLE_COVERAGE enable_coverage "${ENABLE_VAL}" "Enables coverage" )
32 ARG_ENABLE( PRINT_HELP print_help "${ENABLE_VAL}" "Prints help" )
35 MESSAGE( STATUS ${HELP_ENABLES} )
39 IF( NOT enable_profile )
41 SET( enable_profile ANDROID )
43 SET( enable_profile UBUNTU )
47 # Test for profile and exit if something wrong
48 SET( VALID_PROFILES COMMON MOBILE WEARABLE TV IVI UBUNTU ANDROID WINDOWS )
49 LIST( FIND VALID_PROFILES ${enable_profile} RESULT )
51 MESSAGE( FATAL_ERROR "Invalid profile!" )
54 # Defines profile specific variable
55 SET( ${enable_profile}_PROFILE 1 )
57 # TODO check what version we really need for Android
59 SET( FREETYPE_REQUIRED 6.16.0 )
60 SET( FREETYPE_BITMAP_SUPPORT_VERSION 6.16.0 )
62 SET( FREETYPE_REQUIRED 9.16.3 )
63 SET( FREETYPE_BITMAP_SUPPORT_VERSION 17.1.11 )
66 SET( ELDBUS_REQUIRED 1.16.0 )
68 # checking all possibly used modules (required and optionals)
69 CHECK_MODULE_AND_SET( EXIF exif exif_available )
70 CHECK_MODULE_AND_SET( FREETYPE freetype2>=${FREETYPE_REQUIRED} freetype_available )
71 CHECK_MODULE_AND_SET( FREETYPE_BITMAP_SUPPORT freetype2>=${FREETYPE_BITMAP_SUPPORT_VERSION} freetype_bitmap_support)
72 CHECK_MODULE_AND_SET( FONTCONFIG fontconfig fontconfig_available )
73 CHECK_MODULE_AND_SET( PNG libpng [] )
74 CHECK_MODULE_AND_SET( WEBP libwebp webp_available )
75 CHECK_MODULE_AND_SET( WEBP_DEMUX libwebpdemux [] )
76 CHECK_MODULE_AND_SET( LIBEXIF libexif [] )
77 CHECK_MODULE_AND_SET( LIBDRM libdrm [] )
78 CHECK_MODULE_AND_SET( LIBCURL libcurl [] )
79 CHECK_MODULE_AND_SET( HARFBUZZ harfbuzz [] )
80 CHECK_MODULE_AND_SET( FRIBIDI fribidi [] )
81 CHECK_MODULE_AND_SET( CAIRO cairo [] )
82 CHECK_MODULE_AND_SET( EVAS evas [] )
83 CHECK_MODULE_AND_SET( TTRACE ttrace ENABLE_TTRACE )
84 CHECK_MODULE_AND_SET( ECORE ecore [] )
85 CHECK_MODULE_AND_SET( ECORE_IPC ecore-ipc [] )
86 CHECK_MODULE_AND_SET( ECORE_IMF ecore-imf [] )
87 CHECK_MODULE_AND_SET( ELDBUS eldbus>=${ELDBUS_REQUIRED} eldbus_available )
88 CHECK_MODULE_AND_SET( TPKP_CURL tpkp-curl tpkp_curl_available )
89 CHECK_MODULE_AND_SET( UTILX utilX utilx_available )
90 CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
91 CHECK_MODULE_AND_SET( EGL egl [] )
92 CHECK_MODULE_AND_SET( DLOG dlog [] )
93 CHECK_MODULE_AND_SET( TTS tts [] )
94 CHECK_MODULE_AND_SET( VCONF vconf [] )
96 CHECK_MODULE_AND_SET( CAPI_SYSTEM_INFO capi-system-info [] )
97 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SENSOR capi-system-sensor capi_system_sensor_support )
98 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SYSTEM_SETTINGS capi-system-system-settings [] )
99 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION capi-appfw-application [] )
100 CHECK_MODULE_AND_SET( COMPONENT_BASED_CORE_BASE component-based-core-base [] )
102 CHECK_MODULE_AND_SET( ELEMENTARY elementary [] )
103 CHECK_MODULE_AND_SET( BUNDLE bundle [] )
104 CHECK_MODULE_AND_SET( SCREENCONNECTORPROVIDER screen_connector_provider [] )
105 CHECK_MODULE_AND_SET( APPFW_WATCH capi-appfw-watch-application watch_available )
106 CHECK_MODULE_AND_SET( APPCORE_WATCH appcore-watch [] )
108 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION appcore-ui [] )
109 CHECK_MODULE_AND_SET( CAPI_APPFW_WIDGET_BASE appcore-widget-base [] )
110 CHECK_MODULE_AND_SET( CAPI_APPFW_COMMON capi-appfw-app-common [] )
111 CHECK_MODULE_AND_SET( CAPI_APPFW_CONTROL capi-appfw-app-control [] )
113 CHECK_MODULE_AND_SET( DALICORE dali2-core [] )
115 IF( ANDROID_PROFILE )
116 INCLUDE_DIRECTORIES( ${ANDROID_NDK} )
117 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources )
118 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android )
119 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android/native_app_glue )
120 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr )
121 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr/include/android )
125 IF( enable_ecore_wayland2 )
126 PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
128 PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
132 CHECK_MODULE_AND_SET( ECORE_X ecore-x DALI_USE_ECORE_X11 [] )
133 CHECK_MODULE_AND_SET( X11 x11 DALI_USE_X11 [] )
136 CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] )
138 IF( enable_tizen_major_version GREATER 5 )
139 IF( enable_tizen_minor_version GREATER 5 )
140 CHECK_MODULE_AND_SET( AUTOFILL capi-ui-autofill [] )
141 ADD_DEFINITIONS( -DCAPI_AUTOFILL_SUPPORT )
146 IF( watch_available AND WEARABLE_PROFILE )
147 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
150 IF( eldbus_available )
151 SET(DALI_ELDBUS_AVAILABLE 1)
152 ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
156 SET(DALI_WEBP_AVAILABLE 1)
157 ADD_DEFINITIONS( -DDALI_WEBP_AVAILABLE )
160 ADD_DEFINITIONS( -DPLATFORM_TIZEN )
163 ADD_DEFINITIONS( -DDEBUG_ENABLED )
164 SET( ENABLE_EXPORTALL ON )
167 IF( NOT ${ENABLE_EXPORTALL} )
168 ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
171 IF( enable_shaderbincache )
172 ADD_DEFINITIONS( -DSHADERBIN_CACHE_ENABLED )
175 IF( enable_networklogging )
176 ADD_DEFINITIONS( -DNETWORK_LOGGING_ENABLED )
179 IF( watch_available AND WEARABLE_PROFILE )
180 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
183 IF( capi_system_sensor_support AND (NOT UBUNTU_PROFILE) )
184 ADD_DEFINITIONS( -DCAPI_SYSTEM_SENSOR_SUPPORT )
187 IF( enable_appfw AND (enable_tizen_major_version EQUAL 3) )
188 ADD_DEFINITIONS( -DWIDGET_AVAILABLE )
191 IF( enable_wayland AND (NOT COMMON_PROFILE) )
192 PKG_CHECK_MODULES( WAYLAND_EXTENSION [xdg-shell-client text-client input-method-client] )
195 IF( freetype_bitmap_support )
196 ADD_DEFINITIONS( -DFREETYPE_BITMAP_SUPPORT )
199 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
200 ADD_COMPILE_OPTIONS( --coverage )
201 SET(ENABLE_COVERAGE ON)
202 SET(COVERAGE --coverage)
205 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
206 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
208 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
211 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
212 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
214 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
217 IF( DEFINED ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
218 SET( tizenPlatformConfigSupported $ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
219 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "YES" )
221 SET( tizenPlatformConfigSupported 0 )
222 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "NO" )
225 IF( DEFINED ENV{FONT_CONFIGURATION_FILE} )
226 SET( fontConfigurationFile $ENV{FONT_CONFIGURATION_FILE} )
230 SET( cachePath $ENV{HOME} )
232 SET( cachePath /home/owner )
236 ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
239 #######################################################
241 ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
242 SET( DALI_PROFILE_CFLAGS -DDALI_PROFILE_${enable_profile} )
244 # Platforms with highp shader support can use vector based text
245 ADD_DEFINITIONS( "-DENABLE_VECTOR_BASED_TEXT_RENDERING" )
247 CONDITIONAL( WAYLAND enable_wayland )
249 # set lowercase profile name
250 STRING( TOLOWER ${ENABLE_PROFILE} PROFILE_LCASE )
252 ##########################################################3
253 # Default CFLAGS of packages
256 ${DALI_ADAPTOR_CFLAGS}
270 ${CAPI_SYSTEM_SENSOR_CFLAGS}
278 # Default set of linked librarires
281 ${OPENGLES20_LDFLAGS}
283 ${FONTCONFIG_LDFLAGS}
287 ${WEBP_DEMUX_LDFLAGS}
292 ${CAPI_SYSTEM_SENSOR_LDFLAGS}
306 # Android includes pthread with android lib
307 if( NOT ANDROID_PROFILE )
308 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
313 # You need to include manually private and Android libs deps in order to link for Android
314 IF( ANDROID_PROFILE )
315 CHECK_MODULE_AND_SET( PIXMAN pixman-1 [] )
316 CHECK_MODULE_AND_SET( EXPAT expat [] )
318 SET( DALI_CFLAGS ${DALI_CFLAGS}
324 LIST( APPEND DALI_LDFLAGS
338 # EVAS used indicator
339 SET( DALI_CFLAGS ${DALI_CFLAGS}
346 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
353 SET( DALI_CFLAGS ${DALI_CFLAGS}
354 ${CAPI_APPFW_APPLICATION_CFLAGS}
355 ${CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS}
356 ${CAPI_SYSTEM_INFO_CFLAGS}
360 ${CAPI_APPFW_COMMON_CFLAGS}
361 ${CAPI_APPFW_CONTROL_CFLAGS}
362 ${CAPI_APPFW_WIDGET_BASE_CFLAGS}
365 ${COMPONENT_BASED_CORE_BASE_CFLAGS}
368 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
369 ${CAPI_APPFW_APPLICATION_LDFLAGS}
370 ${CAPI_SYSTEM_SYSTEM_SETTINGS_LDFLAGS}
371 ${CAPI_SYSTEM_INFO_LDFLAGS}
375 ${CAPI_APPFW_COMMON_LDFLAGS}
376 ${CAPI_APPFW_CONTROL_LDFLAGS}
377 ${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
380 ${COMPONENT_BASED_CORE_BASE_LDFLAGS}
383 SET( DALI_CFLAGS ${DALI_CFLAGS}
387 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
388 ${ELEMENTARY_LDFLAGS}
394 SET( DALI_CFLAGS ${DALI_CFLAGS}
398 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
402 SET( DALI_CFLAGS ${DALI_CFLAGS}
405 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
413 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
418 SET( DALI_CFLAGS ${DALI_CFLAGS}
421 ${NATIVE_BUFFER_CFLAGS}
422 ${NATIVE_BUFFER_POOL_CFLAGS}
425 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
426 ${EFL_ASSIST_LDFLAGS}
427 ${NATIVE_BUFFER_LDFLAGS}
428 ${NATIVE_BUFFER_POOL_LDFLAGS}
433 IF( WEARABLE_PROFILE )
434 SET( DALI_CFLAGS ${DALI_CFLAGS}
437 ${SCREENCONNECTORPROVIDER_CFLAGS}
438 ${APPCORE_WATCH_CFLAGS}
440 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
441 ${SCREENCONNECTORPROVIDER_LDFLAGS}
442 ${APPCORE_WATCH_LDFLAGS}
448 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
453 SET( DALI_CFLAGS ${DALI_CFLAGS}
456 ${NATIVE_BUFFER_CFLAGS}
457 ${NATIVE_BUFFER_POOL_CFLAGS}
459 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
460 ${EFL_ASSIST_LDFLAGS}
461 ${NATIVE_BUFFER_LDFLAGS}
462 ${NATIVE_BUFFER_POOL_LDFLAGS}
468 SET( DALI_CFLAGS ${DALI_CFLAGS} -fPIC )
469 SET( DALI_LDFLAGS ${DALI_LDFLAGS} -ljpeg )
472 IF( NOT COMMON_PROFILE )
473 ADD_DEFINITIONS( -DWAYLAND_EXTENSIONS_SUPPORTED )
476 # had to do it here for Android by some reason, even if it is set above already
477 IF( ANDROID_PROFILE )
478 SET( daliReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
479 SET( daliReadWriteDir $ENV{DALI_DATA_RW_DIR} )
482 SET( daliDefaultThemeDir ${dataReadWriteDir}/theme/ )
483 SET( fontPreloadedPath $ENV{FONT_PRELOADED_PATH} )
484 SET( fontDownloadedPath $ENV{FONT_DOWNLOADED_PATH} )
485 SET( fontApplicationPath $ENV{FONT_APPLICATION_PATH} )
488 ADD_DEFINITIONS( -DDALI_DATA_RW_DIR="${daliReadWriteDir}"
489 -DDALI_DATA_RO_DIR="${daliReadOnlyDir}"
490 -DDALI_DEFAULT_FONT_CACHE_DIR="${daliDefaultFontCacheDir}"
491 -DDALI_USER_FONT_CACHE_DIR="${daliUserFontCacheDir}"
492 -DDALI_SHADERBIN_DIR="${daliShaderbinCacheDir}"
493 -DDALI_DEFAULT_THEME_DIR="${daliDefaultThemeDir}"
494 -DFONT_PRELOADED_PATH="${fontPreloadedPath}"
495 -DFONT_DOWNLOADED_PATH="${fontDownloadedPath}"
496 -DFONT_APPLICATION_PATH="${fontApplicationPath}"
497 -DFONT_CONFIGURATION_FILE="${fontConfigurationFile}"
498 -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported}