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 # checking all possibly used modules (required and optionals)
64 CHECK_MODULE_AND_SET( EXIF exif exif_available )
65 CHECK_MODULE_AND_SET( FREETYPE freetype2>=${FREETYPE_REQUIRED} freetype_available )
66 CHECK_MODULE_AND_SET( FREETYPE_BITMAP_SUPPORT freetype2>=${FREETYPE_BITMAP_SUPPORT_VERSION} freetype_bitmap_support)
67 CHECK_MODULE_AND_SET( FONTCONFIG fontconfig fontconfig_available )
68 CHECK_MODULE_AND_SET( PNG libpng [] )
69 CHECK_MODULE_AND_SET( LIBEXIF libexif [] )
70 CHECK_MODULE_AND_SET( LIBDRM libdrm [] )
71 CHECK_MODULE_AND_SET( LIBCURL libcurl [] )
72 CHECK_MODULE_AND_SET( HARFBUZZ harfbuzz [] )
73 CHECK_MODULE_AND_SET( FRIBIDI fribidi [] )
74 CHECK_MODULE_AND_SET( CAIRO cairo [] )
75 CHECK_MODULE_AND_SET( EVAS evas [] )
76 CHECK_MODULE_AND_SET( TTRACE ttrace ENABLE_TTRACE )
77 CHECK_MODULE_AND_SET( ECORE ecore [] )
78 CHECK_MODULE_AND_SET( ECORE_IPC ecore-ipc [] )
79 CHECK_MODULE_AND_SET( ECORE_IMF ecore-imf [] )
80 CHECK_MODULE_AND_SET( ELDBUS eldbus eldbus_available )
81 CHECK_MODULE_AND_SET( UTILX utilX utilx_available )
82 CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
83 CHECK_MODULE_AND_SET( EGL egl [] )
84 CHECK_MODULE_AND_SET( DLOG dlog [] )
85 CHECK_MODULE_AND_SET( TTS tts [] )
86 CHECK_MODULE_AND_SET( VCONF vconf [] )
88 CHECK_MODULE_AND_SET( CAPI_SYSTEM_INFO capi-system-info [] )
89 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SENSOR capi-system-sensor capi_system_sensor_support )
90 CHECK_MODULE_AND_SET( CAPI_SYSTEM_SYSTEM_SETTINGS capi-system-system-settings [] )
91 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION capi-appfw-application [] )
93 CHECK_MODULE_AND_SET( ELEMENTARY elementary [] )
94 CHECK_MODULE_AND_SET( BUNDLE bundle [] )
95 CHECK_MODULE_AND_SET( SCREENCONNECTORPROVIDER screen_connector_provider [] )
96 CHECK_MODULE_AND_SET( APPFW_WATCH capi-appfw-watch-application watch_available )
97 CHECK_MODULE_AND_SET( APPCORE_WATCH appcore-watch [] )
99 CHECK_MODULE_AND_SET( CAPI_APPFW_APPLICATION appcore-ui [] )
100 CHECK_MODULE_AND_SET( CAPI_APPFW_WIDGET_BASE appcore-widget-base [] )
101 CHECK_MODULE_AND_SET( CAPI_APPFW_COMMON capi-appfw-app-common [] )
102 CHECK_MODULE_AND_SET( CAPI_APPFW_CONTROL capi-appfw-app-control [] )
104 CHECK_MODULE_AND_SET( DALICORE dali-core [] )
106 IF( ANDROID_PROFILE )
107 INCLUDE_DIRECTORIES( ${ANDROID_NDK} )
108 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources )
109 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android )
110 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android/native_app_glue )
111 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr )
112 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sysroot/usr/include/android )
116 IF( enable_ecore_wayland2 )
117 PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
119 PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
123 CHECK_MODULE_AND_SET( ECORE_X ecore-x DALI_USE_ECORE_X11 [] )
124 CHECK_MODULE_AND_SET( X11 x11 DALI_USE_X11 [] )
127 CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] )
130 IF( watch_available AND WEARABLE_PROFILE )
131 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
134 IF( eldbus_available )
135 SET(DALI_ELDBUS_AVAILABLE 1)
136 ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
139 ADD_DEFINITIONS( -DPLATFORM_TIZEN )
142 ADD_DEFINITIONS( -DDEBUG_ENABLED )
143 SET( ENABLE_EXPORTALL ON )
146 IF( NOT ${ENABLE_EXPORTALL} )
147 ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
150 IF( enable_shaderbincache )
151 ADD_DEFINITIONS( -DSHADERBIN_CACHE_ENABLED )
154 IF( enable_networklogging )
155 ADD_DEFINITIONS( -DNETWORK_LOGGING_ENABLED )
158 IF( watch_available AND WEARABLE_PROFILE )
159 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
162 IF( capi_system_sensor_support AND (NOT UBUNTU_PROFILE) )
163 ADD_DEFINITIONS( -DCAPI_SYSTEM_SENSOR_SUPPORT )
166 IF( enable_appfw AND (enable_tizen_major_version EQUAL 3) )
167 ADD_DEFINITIONS( -DWIDGET_AVAILABLE )
170 IF( enable_wayland AND (NOT COMMON_PROFILE) )
171 PKG_CHECK_MODULES( WAYLAND_EXTENSION [xdg-shell-client text-client input-method-client] )
174 IF( freetype_bitmap_support )
175 ADD_DEFINITIONS( -DFREETYPE_BITMAP_SUPPORT )
178 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
179 ADD_COMPILE_OPTIONS( --coverage )
180 SET(ENABLE_COVERAGE ON)
181 SET(COVERAGE --coverage)
184 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
185 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
187 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
190 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
191 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
193 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
196 IF( DEFINED ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
197 SET( tizenPlatformConfigSupported $ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
198 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "YES" )
200 SET( tizenPlatformConfigSupported 0 )
201 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "NO" )
204 IF( DEFINED ENV{FONT_CONFIGURATION_FILE} )
205 SET( fontConfigurationFile $ENV{FONT_CONFIGURATION_FILE} )
209 SET( cachePath $ENV{HOME} )
211 SET( cachePath /home/owner )
214 #######################################################
216 ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
217 SET( DALI_PROFILE_CFLAGS -DDALI_PROFILE_${enable_profile} )
219 # Platforms with highp shader support can use vector based text
220 CONDITIONAL( ENABLE_VECTOR_BASED_TEXT_RENDERING UBUNTU_PROFILE )
221 CONDITIONAL( WAYLAND enable_wayland )
223 # set lowercase profile name
224 STRING( TOLOWER ${ENABLE_PROFILE} PROFILE_LCASE )
226 ##########################################################3
227 # Default CFLAGS of packages
230 ${DALI_ADAPTOR_CFLAGS}
242 ${CAPI_SYSTEM_SENSOR_CFLAGS}
250 # Default set of linked librarires
253 ${OPENGLES20_LDFLAGS}
255 ${FONTCONFIG_LDFLAGS}
262 ${CAPI_SYSTEM_SENSOR_LDFLAGS}
274 # Android includes pthread with android lib
275 if( NOT ANDROID_PROFILE )
276 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
281 # You need to include manually private and Android libs deps in order to link for Android
282 IF( ANDROID_PROFILE )
283 CHECK_MODULE_AND_SET( PIXMAN pixman-1 [] )
284 CHECK_MODULE_AND_SET( EXPAT expat [] )
286 SET( DALI_CFLAGS ${DALI_CFLAGS}
292 LIST( APPEND DALI_LDFLAGS
306 # EVAS used indicator
307 SET( DALI_CFLAGS ${DALI_CFLAGS}
314 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
321 SET( DALI_CFLAGS ${DALI_CFLAGS}
322 ${CAPI_APPFW_APPLICATION_CFLAGS}
323 ${CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS}
324 ${CAPI_SYSTEM_INFO_CFLAGS}
328 ${CAPI_APPFW_COMMON_CFLAGS}
329 ${CAPI_APPFW_CONTROL_CFLAGS}
330 ${CAPI_APPFW_WIDGET_BASE_CFLAGS}
335 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
336 ${CAPI_APPFW_APPLICATION_LDFLAGS}
337 ${CAPI_SYSTEM_SYSTEM_SETTINGS_LDFLAGS}
338 ${CAPI_SYSTEM_INFO_LDFLAGS}
342 ${CAPI_APPFW_COMMON_LDFLAGS}
343 ${CAPI_APPFW_CONTROL_LDFLAGS}
344 ${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
349 SET( DALI_CFLAGS ${DALI_CFLAGS}
353 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
354 ${ELEMENTARY_LDFLAGS}
360 SET( DALI_CFLAGS ${DALI_CFLAGS}
364 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
368 SET( DALI_CFLAGS ${DALI_CFLAGS}
371 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
379 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
384 SET( DALI_CFLAGS ${DALI_CFLAGS}
387 ${NATIVE_BUFFER_CFLAGS}
388 ${NATIVE_BUFFER_POOL_CFLAGS}
391 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
392 ${EFL_ASSIST_LDFLAGS}
393 ${NATIVE_BUFFER_LDFLAGS}
394 ${NATIVE_BUFFER_POOL_LDFLAGS}
399 IF( WEARABLE_PROFILE )
400 SET( DALI_CFLAGS ${DALI_CFLAGS}
403 ${SCREENCONNECTORPROVIDER_CFLAGS}
404 ${APPCORE_WATCH_CFLAGS}
406 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
407 ${SCREENCONNECTORPROVIDER_LDFLAGS}
408 ${APPCORE_WATCH_LDFLAGS}
414 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
419 SET( DALI_CFLAGS ${DALI_CFLAGS}
422 ${NATIVE_BUFFER_CFLAGS}
423 ${NATIVE_BUFFER_POOL_CFLAGS}
425 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
426 ${EFL_ASSIST_LDFLAGS}
427 ${NATIVE_BUFFER_LDFLAGS}
428 ${NATIVE_BUFFER_POOL_LDFLAGS}
434 SET( DALI_CFLAGS ${DALI_CFLAGS} -fPIC )
435 SET( DALI_LDFLAGS ${DALI_LDFLAGS} -ljpeg )
438 IF( NOT COMMON_PROFILE )
439 ADD_DEFINITIONS( -DWAYLAND_EXTENSIONS_SUPPORTED )
442 # had to do it here for Android by some reason, even if it is set above already
443 IF( ANDROID_PROFILE )
444 SET( daliReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
445 SET( daliReadWriteDir $ENV{DALI_DATA_RW_DIR} )
448 SET( daliDefaultThemeDir ${dataReadWriteDir}/theme/ )
449 SET( fontPreloadedPath $ENV{FONT_PRELOADED_PATH} )
450 SET( fontDownloadedPath $ENV{FONT_DOWNLOADED_PATH} )
451 SET( fontApplicationPath $ENV{FONT_APPLICATION_PATH} )
454 ADD_DEFINITIONS( -DDALI_DATA_RW_DIR="${daliReadWriteDir}"
455 -DDALI_DATA_RO_DIR="${daliReadOnlyDir}"
456 -DDALI_DEFAULT_FONT_CACHE_DIR="${daliDefaultFontCacheDir}"
457 -DDALI_USER_FONT_CACHE_DIR="${daliUserFontCacheDir}"
458 -DDALI_SHADERBIN_DIR="${daliShaderbinCacheDir}"
459 -DDALI_DEFAULT_THEME_DIR="${daliDefaultThemeDir}"
460 -DFONT_PRELOADED_PATH="${fontPreloadedPath}"
461 -DFONT_DOWNLOADED_PATH="${fontDownloadedPath}"
462 -DFONT_APPLICATION_PATH="${fontApplicationPath}"
463 -DFONT_CONFIGURATION_FILE="${fontConfigurationFile}"
464 -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported}