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 MACOS )
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 CHECK_MODULE_AND_SET( THORVG thorvg thorvg_support )
115 ADD_DEFINITIONS( -DTHORVG_SUPPORT )
118 IF( ANDROID_PROFILE )
119 INCLUDE_DIRECTORIES( ${ANDROID_NDK} )
120 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources )
121 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android )
122 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android/native_app_glue )
123 INCLUDE_DIRECTORIES( ${CMAKE_SYSROOT}/usr )
124 INCLUDE_DIRECTORIES( ${CMAKE_SYSROOT}/usr/include/android )
128 IF( enable_ecore_wayland2 )
129 PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
131 PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
135 CHECK_MODULE_AND_SET( ECORE_X ecore-x DALI_USE_ECORE_X11 [] )
136 CHECK_MODULE_AND_SET( X11 x11 DALI_USE_X11 [] )
139 CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] )
142 IF( watch_available AND WEARABLE_PROFILE )
143 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
146 IF( eldbus_available )
147 SET(DALI_ELDBUS_AVAILABLE 1)
148 ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
152 SET(DALI_WEBP_AVAILABLE 1)
153 ADD_DEFINITIONS( -DDALI_WEBP_AVAILABLE )
156 ADD_DEFINITIONS( -DPLATFORM_TIZEN )
159 ADD_DEFINITIONS( -DDEBUG_ENABLED )
160 SET( ENABLE_EXPORTALL ON )
163 IF( NOT ${ENABLE_EXPORTALL} )
164 ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
167 IF( enable_shaderbincache )
168 ADD_DEFINITIONS( -DSHADERBIN_CACHE_ENABLED )
171 IF( enable_networklogging )
172 ADD_DEFINITIONS( -DNETWORK_LOGGING_ENABLED )
175 IF( watch_available AND WEARABLE_PROFILE )
176 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
179 IF( capi_system_sensor_support AND (NOT UBUNTU_PROFILE) )
180 ADD_DEFINITIONS( -DCAPI_SYSTEM_SENSOR_SUPPORT )
183 IF( enable_appfw AND (enable_tizen_major_version EQUAL 3) )
184 ADD_DEFINITIONS( -DWIDGET_AVAILABLE )
187 IF( enable_wayland AND (NOT COMMON_PROFILE) )
188 PKG_CHECK_MODULES( WAYLAND_EXTENSION [xdg-shell-client text-client input-method-client] )
191 IF( freetype_bitmap_support )
192 ADD_DEFINITIONS( -DFREETYPE_BITMAP_SUPPORT )
195 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
196 ADD_COMPILE_OPTIONS( --coverage )
197 SET(ENABLE_COVERAGE ON)
198 SET(COVERAGE --coverage)
201 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
202 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
204 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
207 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
208 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
210 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
213 IF( DEFINED ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
214 SET( tizenPlatformConfigSupported $ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
215 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "YES" )
217 SET( tizenPlatformConfigSupported 0 )
218 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "NO" )
221 IF( DEFINED ENV{FONT_CONFIGURATION_FILE} )
222 SET( fontConfigurationFile $ENV{FONT_CONFIGURATION_FILE} )
225 IF( UBUNTU_PROFILE OR MACOS_PROFILE )
226 SET( cachePath $ENV{HOME} )
228 SET( cachePath /home/owner )
232 ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
235 #######################################################
237 ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
238 SET( DALI_PROFILE_CFLAGS -DDALI_PROFILE_${enable_profile} )
240 # Platforms with highp shader support can use vector based text
241 ADD_DEFINITIONS( "-DENABLE_VECTOR_BASED_TEXT_RENDERING" )
243 CONDITIONAL( WAYLAND enable_wayland )
245 # set lowercase profile name
246 STRING( TOLOWER ${ENABLE_PROFILE} PROFILE_LCASE )
248 ##########################################################3
249 # Default CFLAGS of packages
252 ${DALI_ADAPTOR_CFLAGS}
267 ${CAPI_SYSTEM_SENSOR_CFLAGS}
276 # Default set of linked librarires
279 ${OPENGLES20_LDFLAGS}
281 ${FONTCONFIG_LDFLAGS}
286 ${WEBP_DEMUX_LDFLAGS}
291 ${CAPI_SYSTEM_SENSOR_LDFLAGS}
304 # Android includes pthread with android lib
305 if( NOT ANDROID_PROFILE )
306 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
311 # You need to include manually private and Android libs deps in order to link for Android
312 IF( ANDROID_PROFILE )
313 CHECK_MODULE_AND_SET( PIXMAN pixman-1 [] )
314 CHECK_MODULE_AND_SET( EXPAT expat [] )
316 SET( DALI_CFLAGS ${DALI_CFLAGS}
322 LIST( APPEND DALI_LDFLAGS
336 # EVAS used indicator
337 SET( DALI_CFLAGS ${DALI_CFLAGS}
344 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
351 SET( DALI_CFLAGS ${DALI_CFLAGS}
352 ${CAPI_APPFW_APPLICATION_CFLAGS}
353 ${CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS}
354 ${CAPI_SYSTEM_INFO_CFLAGS}
358 ${CAPI_APPFW_COMMON_CFLAGS}
359 ${CAPI_APPFW_CONTROL_CFLAGS}
360 ${CAPI_APPFW_WIDGET_BASE_CFLAGS}
363 ${COMPONENT_BASED_CORE_BASE_CFLAGS}
366 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
367 ${CAPI_APPFW_APPLICATION_LDFLAGS}
368 ${CAPI_SYSTEM_SYSTEM_SETTINGS_LDFLAGS}
369 ${CAPI_SYSTEM_INFO_LDFLAGS}
373 ${CAPI_APPFW_COMMON_LDFLAGS}
374 ${CAPI_APPFW_CONTROL_LDFLAGS}
375 ${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
378 ${COMPONENT_BASED_CORE_BASE_LDFLAGS}
381 SET( DALI_CFLAGS ${DALI_CFLAGS}
385 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
386 ${ELEMENTARY_LDFLAGS}
392 SET( DALI_CFLAGS ${DALI_CFLAGS}
396 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
400 SET( DALI_CFLAGS ${DALI_CFLAGS}
403 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
411 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
416 SET( DALI_CFLAGS ${DALI_CFLAGS}
419 ${NATIVE_BUFFER_CFLAGS}
420 ${NATIVE_BUFFER_POOL_CFLAGS}
423 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
424 ${EFL_ASSIST_LDFLAGS}
425 ${NATIVE_BUFFER_LDFLAGS}
426 ${NATIVE_BUFFER_POOL_LDFLAGS}
431 IF( WEARABLE_PROFILE )
432 SET( DALI_CFLAGS ${DALI_CFLAGS}
435 ${SCREENCONNECTORPROVIDER_CFLAGS}
436 ${APPCORE_WATCH_CFLAGS}
438 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
439 ${SCREENCONNECTORPROVIDER_LDFLAGS}
440 ${APPCORE_WATCH_LDFLAGS}
446 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
451 SET( DALI_CFLAGS ${DALI_CFLAGS}
454 ${NATIVE_BUFFER_CFLAGS}
455 ${NATIVE_BUFFER_POOL_CFLAGS}
457 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
458 ${EFL_ASSIST_LDFLAGS}
459 ${NATIVE_BUFFER_LDFLAGS}
460 ${NATIVE_BUFFER_POOL_LDFLAGS}
466 SET( DALI_CFLAGS ${DALI_CFLAGS} -fPIC )
467 SET( DALI_LDFLAGS ${DALI_LDFLAGS} -ljpeg )
470 IF( NOT COMMON_PROFILE )
471 ADD_DEFINITIONS( -DWAYLAND_EXTENSIONS_SUPPORTED )
474 # had to do it here for Android by some reason, even if it is set above already
475 IF( ANDROID_PROFILE )
476 SET( daliReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
477 SET( daliReadWriteDir $ENV{DALI_DATA_RW_DIR} )
480 SET( daliDefaultThemeDir ${dataReadWriteDir}/theme/ )
481 SET( fontPreloadedPath $ENV{FONT_PRELOADED_PATH} )
482 SET( fontDownloadedPath $ENV{FONT_DOWNLOADED_PATH} )
483 SET( fontApplicationPath $ENV{FONT_APPLICATION_PATH} )
486 ADD_DEFINITIONS( -DDALI_DATA_RW_DIR="${daliReadWriteDir}"
487 -DDALI_DATA_RO_DIR="${daliReadOnlyDir}"
488 -DDALI_DEFAULT_FONT_CACHE_DIR="${daliDefaultFontCacheDir}"
489 -DDALI_USER_FONT_CACHE_DIR="${daliUserFontCacheDir}"
490 -DDALI_SHADERBIN_DIR="${daliShaderbinCacheDir}"
491 -DDALI_DEFAULT_THEME_DIR="${daliDefaultThemeDir}"
492 -DFONT_PRELOADED_PATH="${fontPreloadedPath}"
493 -DFONT_DOWNLOADED_PATH="${fontDownloadedPath}"
494 -DFONT_APPLICATION_PATH="${fontApplicationPath}"
495 -DFONT_CONFIGURATION_FILE="${fontConfigurationFile}"
496 -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported}