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 MACOS )
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 CHECK_MODULE_AND_SET( THORVG thorvg thorvg_support )
118 ADD_DEFINITIONS( -DTHORVG_SUPPORT )
121 IF( ANDROID_PROFILE )
122 INCLUDE_DIRECTORIES( ${ANDROID_NDK} )
123 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources )
124 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android )
125 INCLUDE_DIRECTORIES( ${ANDROID_NDK}/sources/android/native_app_glue )
126 INCLUDE_DIRECTORIES( ${CMAKE_SYSROOT}/usr )
127 INCLUDE_DIRECTORIES( ${CMAKE_SYSROOT}/usr/include/android )
131 IF( enable_ecore_wayland2 )
132 PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
134 PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
138 CHECK_MODULE_AND_SET( ECORE_X ecore-x DALI_USE_ECORE_X11 [] )
139 CHECK_MODULE_AND_SET( X11 x11 DALI_USE_X11 [] )
142 CHECK_MODULE_AND_SET( WAYLAND_EXTENSION xdg-shell-client text-client input-method-client [] )
144 IF( enable_tizen_major_version GREATER 5 )
145 IF( enable_tizen_minor_version GREATER 5 )
146 CHECK_MODULE_AND_SET( AUTOFILL capi-ui-autofill [] )
147 ADD_DEFINITIONS( -DCAPI_AUTOFILL_SUPPORT )
152 IF( watch_available AND WEARABLE_PROFILE )
153 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
156 IF( eldbus_available )
157 SET(DALI_ELDBUS_AVAILABLE 1)
158 ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
162 SET(DALI_WEBP_AVAILABLE 1)
163 ADD_DEFINITIONS( -DDALI_WEBP_AVAILABLE )
166 ADD_DEFINITIONS( -DPLATFORM_TIZEN )
169 ADD_DEFINITIONS( -DDEBUG_ENABLED )
170 SET( ENABLE_EXPORTALL ON )
173 IF( NOT ${ENABLE_EXPORTALL} )
174 ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
177 IF( enable_shaderbincache )
178 ADD_DEFINITIONS( -DSHADERBIN_CACHE_ENABLED )
181 IF( enable_networklogging )
182 ADD_DEFINITIONS( -DNETWORK_LOGGING_ENABLED )
185 IF( watch_available AND WEARABLE_PROFILE )
186 ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
189 IF( capi_system_sensor_support AND (NOT UBUNTU_PROFILE) )
190 ADD_DEFINITIONS( -DCAPI_SYSTEM_SENSOR_SUPPORT )
193 IF( enable_appfw AND (enable_tizen_major_version EQUAL 3) )
194 ADD_DEFINITIONS( -DWIDGET_AVAILABLE )
197 IF( enable_wayland AND (NOT COMMON_PROFILE) )
198 PKG_CHECK_MODULES( WAYLAND_EXTENSION [xdg-shell-client text-client input-method-client] )
201 IF( freetype_bitmap_support )
202 ADD_DEFINITIONS( -DFREETYPE_BITMAP_SUPPORT )
205 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
206 ADD_COMPILE_OPTIONS( --coverage )
207 SET(ENABLE_COVERAGE ON)
208 SET(COVERAGE --coverage)
211 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
212 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
214 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
217 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
218 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
220 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
223 IF( DEFINED ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
224 SET( tizenPlatformConfigSupported $ENV{TIZEN_PLATFORM_CONFIG_SUPPORTED} )
225 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "YES" )
227 SET( tizenPlatformConfigSupported 0 )
228 SET( TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG "NO" )
231 IF( DEFINED ENV{FONT_CONFIGURATION_FILE} )
232 SET( fontConfigurationFile $ENV{FONT_CONFIGURATION_FILE} )
235 IF( UBUNTU_PROFILE OR MACOS_PROFILE )
236 SET( cachePath $ENV{HOME} )
238 SET( cachePath /home/owner )
242 ADD_DEFINITIONS( -DUSE_APPFW -DCOMPONENT_APPLICATION_SUPPORT)
245 #######################################################
247 ADD_DEFINITIONS( -DDALI_PROFILE_${enable_profile})
248 SET( DALI_PROFILE_CFLAGS -DDALI_PROFILE_${enable_profile} )
250 # Platforms with highp shader support can use vector based text
251 ADD_DEFINITIONS( "-DENABLE_VECTOR_BASED_TEXT_RENDERING" )
253 CONDITIONAL( WAYLAND enable_wayland )
255 # set lowercase profile name
256 STRING( TOLOWER ${ENABLE_PROFILE} PROFILE_LCASE )
258 ##########################################################3
259 # Default CFLAGS of packages
262 ${DALI_ADAPTOR_CFLAGS}
277 ${CAPI_SYSTEM_SENSOR_CFLAGS}
286 # Default set of linked librarires
289 ${OPENGLES20_LDFLAGS}
291 ${FONTCONFIG_LDFLAGS}
296 ${WEBP_DEMUX_LDFLAGS}
301 ${CAPI_SYSTEM_SENSOR_LDFLAGS}
316 # Android includes pthread with android lib
317 if( NOT ANDROID_PROFILE )
318 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
323 # You need to include manually private and Android libs deps in order to link for Android
324 IF( ANDROID_PROFILE )
325 CHECK_MODULE_AND_SET( PIXMAN pixman-1 [] )
326 CHECK_MODULE_AND_SET( EXPAT expat [] )
328 SET( DALI_CFLAGS ${DALI_CFLAGS}
334 LIST( APPEND DALI_LDFLAGS
348 # EVAS used indicator
349 SET( DALI_CFLAGS ${DALI_CFLAGS}
356 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
363 SET( DALI_CFLAGS ${DALI_CFLAGS}
364 ${CAPI_APPFW_APPLICATION_CFLAGS}
365 ${CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS}
366 ${CAPI_SYSTEM_INFO_CFLAGS}
370 ${CAPI_APPFW_COMMON_CFLAGS}
371 ${CAPI_APPFW_CONTROL_CFLAGS}
372 ${CAPI_APPFW_WIDGET_BASE_CFLAGS}
375 ${COMPONENT_BASED_CORE_BASE_CFLAGS}
378 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
379 ${CAPI_APPFW_APPLICATION_LDFLAGS}
380 ${CAPI_SYSTEM_SYSTEM_SETTINGS_LDFLAGS}
381 ${CAPI_SYSTEM_INFO_LDFLAGS}
385 ${CAPI_APPFW_COMMON_LDFLAGS}
386 ${CAPI_APPFW_CONTROL_LDFLAGS}
387 ${CAPI_APPFW_WIDGET_BASE_LDFLAGS}
390 ${COMPONENT_BASED_CORE_BASE_LDFLAGS}
393 SET( DALI_CFLAGS ${DALI_CFLAGS}
397 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
398 ${ELEMENTARY_LDFLAGS}
404 SET( DALI_CFLAGS ${DALI_CFLAGS}
408 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
412 SET( DALI_CFLAGS ${DALI_CFLAGS}
415 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
423 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
428 SET( DALI_CFLAGS ${DALI_CFLAGS}
431 ${NATIVE_BUFFER_CFLAGS}
432 ${NATIVE_BUFFER_POOL_CFLAGS}
435 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
436 ${EFL_ASSIST_LDFLAGS}
437 ${NATIVE_BUFFER_LDFLAGS}
438 ${NATIVE_BUFFER_POOL_LDFLAGS}
443 IF( WEARABLE_PROFILE )
444 SET( DALI_CFLAGS ${DALI_CFLAGS}
447 ${SCREENCONNECTORPROVIDER_CFLAGS}
448 ${APPCORE_WATCH_CFLAGS}
450 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
451 ${SCREENCONNECTORPROVIDER_LDFLAGS}
452 ${APPCORE_WATCH_LDFLAGS}
458 SET( DALI_CFLAGS ${DALI_CFLAGS} ${HAPTIC_CFLAGS} )
463 SET( DALI_CFLAGS ${DALI_CFLAGS}
466 ${NATIVE_BUFFER_CFLAGS}
467 ${NATIVE_BUFFER_POOL_CFLAGS}
469 SET( DALI_LDFLAGS ${DALI_LDFLAGS}
470 ${EFL_ASSIST_LDFLAGS}
471 ${NATIVE_BUFFER_LDFLAGS}
472 ${NATIVE_BUFFER_POOL_LDFLAGS}
478 SET( DALI_CFLAGS ${DALI_CFLAGS} -fPIC )
479 SET( DALI_LDFLAGS ${DALI_LDFLAGS} -ljpeg )
482 IF( NOT COMMON_PROFILE )
483 ADD_DEFINITIONS( -DWAYLAND_EXTENSIONS_SUPPORTED )
486 # had to do it here for Android by some reason, even if it is set above already
487 IF( ANDROID_PROFILE )
488 SET( daliReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
489 SET( daliReadWriteDir $ENV{DALI_DATA_RW_DIR} )
492 SET( daliDefaultThemeDir ${dataReadWriteDir}/theme/ )
493 SET( fontPreloadedPath $ENV{FONT_PRELOADED_PATH} )
494 SET( fontDownloadedPath $ENV{FONT_DOWNLOADED_PATH} )
495 SET( fontApplicationPath $ENV{FONT_APPLICATION_PATH} )
498 ADD_DEFINITIONS( -DDALI_DATA_RW_DIR="${daliReadWriteDir}"
499 -DDALI_DATA_RO_DIR="${daliReadOnlyDir}"
500 -DDALI_DEFAULT_FONT_CACHE_DIR="${daliDefaultFontCacheDir}"
501 -DDALI_USER_FONT_CACHE_DIR="${daliUserFontCacheDir}"
502 -DDALI_SHADERBIN_DIR="${daliShaderbinCacheDir}"
503 -DDALI_DEFAULT_THEME_DIR="${daliDefaultThemeDir}"
504 -DFONT_PRELOADED_PATH="${fontPreloadedPath}"
505 -DFONT_DOWNLOADED_PATH="${fontDownloadedPath}"
506 -DFONT_APPLICATION_PATH="${fontApplicationPath}"
507 -DFONT_CONFIGURATION_FILE="${fontConfigurationFile}"
508 -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported}