1 CMAKE_MINIMUM_REQUIRED(VERSION 3.8.2)
2 CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
4 SET(name "dali2-toolkit")
6 SET(CMAKE_C_STANDARD 99)
7 SET(CMAKE_CXX_STANDARD 17)
11 SET(GCC_COMPILER_VERSION_REQUIRED "6")
12 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
13 if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_COMPILER_VERSION_REQUIRED)
14 message(FATAL_ERROR "The GCC required compiler version is " ${GCC_COMPILER_VERSION_REQUIRED})
18 # API VERSION (Not DALi release version)
19 SET(${name}_VERSION_MAJOR 2)
20 SET(${name}_VERSION_MINOR 0)
21 SET(${name}_VERSION_PATCH 0)
22 SET(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH} )
24 SET(DALI_TOOLKIT_VERSION ${${name}_VERSION} )
26 # Define options to CMake
27 OPTION(ENABLE_EXPORTALL "Enable Export all symbols" OFF)
28 OPTION(ENABLE_DEBUG "Enable Debug" OFF)
29 OPTION(ENABLE_TRACE "Enable Trace" OFF)
30 OPTION(ENABLE_I18N "Turns on internationalisation" OFF)
31 OPTION(ENABLE_COVERAGE "Coverage" OFF)
32 OPTION(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON)
33 OPTION(ENABLE_LINK_TEST "Enable the link test" ON)
34 OPTION(INSTALL_DOXYGEN_DOC "Install doxygen doc" ON)
35 OPTION(CONFIGURE_AUTOMATED_TESTS "Configure automated tests" ON)
36 OPTION(USE_DEFAULT_RESOURCE_DIR "Whether to use the default resource folders. Otherwise set environment variables for DALI_IMAGE_DIR, DALI_SOUND_DIR, DALI_STYLE_DIR, DALI_STYLE_IMAGE_DIR and DALI_DATA_READ_ONLY_DIR" ON)
37 OPTION(BUILD_SCENE_LOADER "Whether to build dali-scene-loader." ON)
39 IF( ENABLE_PKG_CONFIGURE )
40 FIND_PACKAGE( PkgConfig REQUIRED )
42 PKG_CHECK_MODULES(DALICORE REQUIRED dali2-core)
43 PKG_CHECK_MODULES(DALIADAPTOR REQUIRED dali2-adaptor)
46 IF( INSTALL_DOXYGEN_DOC )
47 FIND_PACKAGE( Doxygen QUIET )
50 IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
51 FIND_PACKAGE( dali-windows-dependencies REQUIRED)
52 FIND_PACKAGE( dali2-core REQUIRED)
53 FIND_PACKAGE( dali2-adaptor REQUIRED)
57 FIND_PACKAGE( dali2-core REQUIRED)
58 FIND_PACKAGE( dali2-adaptor REQUIRED)
61 SET( VCPKG_INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
63 # Define non-boolean options to CMake
64 SET(WITH_STYLE "480x800" CACHE STRING "Select the style folder to use")
66 # from root/build/tizen, get back to root
67 SET(ROOT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../)
69 # Deployment folder should come from spec file or command line:
70 SET( PREFIX ${CMAKE_INSTALL_PREFIX})
71 SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
73 # Make sure the path is absolute
74 GET_FILENAME_COMPONENT(ROOT_SRC_DIR ${ROOT_SRC_DIR} ABSOLUTE)
77 SET( dali_style ${WITH_STYLE} )
80 SET( STYLE_BASE_DIR ${ROOT_SRC_DIR}/dali-toolkit/styles )
81 SET( STYLE_DIR ${STYLE_BASE_DIR}/${dali_style} )
83 SET( toolkit_styles_base_dir ${STYLE_BASE_DIR} )
84 SET( toolkit_styles_dir ${STYLE_DIR} )
85 SET( toolkit_style_images_dir ${STYLE_DIR}/images )
87 IF( DEFINED ENV{DALI_DATA_RW_DIR} )
88 SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} )
90 SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
93 IF( DEFINED ENV{DALI_DATA_RO_DIR} )
94 SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} )
96 SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
99 # Set up compiler definitions
101 IF(CMAKE_BUILD_TYPE MATCHES Debug)
102 SET( ENABLE_DEBUG ON )
106 MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Debug )
107 ADD_DEFINITIONS( "-DDEBUG_ENABLED" )
108 SET( ENABLE_EXPORTALL ON )
110 MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release )
114 ADD_DEFINITIONS( "-DDGETTEXT_ENABLED" )
118 ADD_DEFINITIONS( "-DBUILDING_DALI_TOOLKIT" )
120 IF( USE_DEFAULT_RESOURCE_DIR )
121 SET( INSTALL_SHARE_DIR "${PREFIX}/share" )
122 IF( VCPKG_TOOLKIT_BUILD )
123 SET( INSTALL_SHARE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share" )
126 ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/images/\"
127 -DDALI_SOUND_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/sounds/\"
128 -DDALI_STYLE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/styles/\"
129 -DDALI_STYLE_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/styles/images/\"
130 -DDALI_DATA_READ_ONLY_DIR=\"${INSTALL_SHARE_DIR}/\" )
133 ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
134 IF( USE_DEFAULT_RESOURCE_DIR )
135 ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/images/\"
136 -DDALI_SOUND_DIR=\"${dataReadOnlyDir}/toolkit/sounds/\"
137 -DDALI_STYLE_DIR=\"${dataReadOnlyDir}/toolkit/styles/\"
138 -DDALI_STYLE_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/styles/images/\"
139 -DDALI_DATA_READ_ONLY_DIR=\"${dataReadOnlyDir}\" )
142 IF("${ARCH}" STREQUAL "arm")
143 ADD_DEFINITIONS("-DTARGET")
144 ENDIF("${ARCH}" STREQUAL "arm")
146 IF( NOT ${ENABLE_EXPORTALL} )
147 ADD_DEFINITIONS( "-DHIDE_DALI_INTERNALS" )
148 ENDIF( NOT ${ENABLE_EXPORTALL} )
151 IF( NOT USE_DEFAULT_RESOURCE_DIR )
152 ADD_DEFINITIONS( -DDALI_IMAGE_DIR=0
155 -DDALI_STYLE_IMAGE_DIR=0
156 -DDALI_DATA_READ_ONLY_DIR=0 )
160 ADD_DEFINITIONS("-DTRACE_ENABLED")
163 # Remove below when thorvg is ready
164 ADD_DEFINITIONS( "-DNO_THORVG" )
167 SET( toolkit_images_dir ${ROOT_SRC_DIR}/dali-toolkit/styles/images-common )
168 SET( toolkit_sounds_dir ${ROOT_SRC_DIR}/dali-toolkit/sounds )
169 SET( toolkit_src_dir ${ROOT_SRC_DIR}/dali-toolkit/internal )
170 SET( public_api_src_dir ${ROOT_SRC_DIR}/dali-toolkit/public-api )
171 SET( devel_api_src_dir ${ROOT_SRC_DIR}/dali-toolkit/devel-api )
172 SET( third_party_src_dir ${ROOT_SRC_DIR}/dali-toolkit/third-party )
173 SET( package_doxy_dir ${ROOT_SRC_DIR}/doc )
175 # Set up the include dir
176 SET( INCLUDE_DIR $ENV{includedir} )
177 IF( NOT INCLUDE_DIR )
178 SET( INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
180 IF( NOT INCLUDE_DIR )
181 SET( INCLUDE_DIR ${PREFIX}/include )
185 SET( LIB_DIR $ENV{libdir} )
187 SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
190 SET( LIB_DIR ${PREFIX}/lib )
194 SET( BIN_DIR $ENV{bindir} )
196 SET( BIN_DIR ${CMAKE_INSTALL_BINDIR} )
199 SET( BIN_DIR ${PREFIX}/bin )
202 IF( ENABLE_PKG_CONFIGURE )
203 # Configure the pkg-config file
204 # Requires the following variables to be setup:
205 # @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
206 SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
207 SET( CORE_PKG_CFG_FILE dali2-toolkit.pc )
208 CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
212 ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
213 ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
214 ADD_COMPILE_OPTIONS( /wd4251 ) # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
216 INCLUDE(CheckCXXCompilerFlag)
218 # Set up compiler flags and warnings
219 ADD_COMPILE_OPTIONS( -Wno-ignored-qualifiers )
221 # TODO: Clang is a lot more strict with warnings, we should address
222 # those issues at some point.
223 # Matches "Clang" or "AppleClang"
224 IF( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
225 ADD_COMPILE_OPTIONS( -Werror )
228 ADD_COMPILE_OPTIONS( -Wall -Wno-unused-parameter -Wno-float-equal )
229 ADD_COMPILE_OPTIONS( -Wall -Wno-unused-parameter -Wno-float-equal )
230 CHECK_CXX_COMPILER_FLAG(-Wno-class-memaccess HAVE_NO_CLASS_MEMACCESS)
231 IF (HAVE_NO_CLASS_MEMACCESS)
232 ADD_COMPILE_OPTIONS( -Wno-class-memaccess )
235 IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
236 ADD_COMPILE_OPTIONS( --coverage )
237 SET(ENABLE_COVERAGE ON)
238 SET(COVERAGE --coverage)
241 IF( NOT ${ENABLE_EXPORTALL} )
242 ADD_COMPILE_OPTIONS( "-fvisibility=hidden" )
243 ENDIF( NOT ${ENABLE_EXPORTALL} )
249 ${DALICORE_INCLUDE_DIRS}
250 ${DALIADAPTOR_INCLUDE_DIRS}
255 SET(SOURCE_DIR "${ROOT_SRC_DIR}/dali")
256 SET(PACKAGE_DOXY_SRC_DIR "${ROOT_SRC_DIR}/doc")
260 # could use INCLUDE to get the source lists a different way;
261 # would then need to specify a build folder somehow...
262 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/sounds/file.list )
263 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/styles/file.list )
264 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/styles/images-common/file.list )
265 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/internal/file.list )
266 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/public-api/file.list )
267 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/devel-api/file.list )
268 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/third-party/file.list )
269 INCLUDE( ${ROOT_SRC_DIR}/doc/file.list )
271 # Platforms with highp shader support can use vector based text
272 IF( NOT DEFINED ENABLE_VECTOR_BASED_TEXT_RENDERING )
273 SET(ENABLE_VECTOR_BASED_TEXT_RENDERING ON)
276 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
277 ADD_DEFINITIONS( "-DENABLE_VECTOR_BASED_TEXT_RENDERING" )
278 INCLUDE( ${ROOT_SRC_DIR}/dali-toolkit/internal/text/rendering/vector-based/file.list )
286 # Generate source files for shaders
287 SET(SHADER_SOURCE_DIR "${ROOT_SRC_DIR}/dali-toolkit/internal/graphics/shaders/")
288 SET(SHADER_GENERATED_DIR "${ROOT_SRC_DIR}/dali-toolkit/internal/graphics/generated")
290 SET(GENERATED_SHADER_DIR ${ROOT_SRC_DIR}/dali-toolkit/internal/graphics/)
291 SET_PROPERTY(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
292 "${GENERATED_SHADER_DIR}/generated/"
293 "${GENERATED_SHADER_DIR}/builtin-shader-extern-gen.h")
295 SET(SHADER_GENERATOR_NAME dali-shader-generator)
296 SET(SHADER_GENERATOR_SOURCES ${ROOT_SRC_DIR}/dali-toolkit/shader-generator/shader-generator.cpp)
299 # When Using VCPKG, the default is always set to Debug if CMAKE_BUILD_TYPE is not set
300 IF( NOT CMAKE_BUILD_TYPE )
301 SET(SHADER_GENERATOR_BINARY ${CMAKE_CURRENT_BINARY_DIR}/Debug/${SHADER_GENERATOR_NAME})
303 SET(SHADER_GENERATOR_BINARY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${SHADER_GENERATOR_NAME})
306 SET(SHADER_GENERATOR_BINARY ${CMAKE_CURRENT_BINARY_DIR}/${SHADER_GENERATOR_NAME})
310 ADD_EXECUTABLE(${SHADER_GENERATOR_NAME} ${SHADER_GENERATOR_SOURCES})
311 TARGET_LINK_LIBRARIES( ${SHADER_GENERATOR_NAME} ${COVERAGE} )
312 INSTALL(TARGETS ${SHADER_GENERATOR_NAME} RUNTIME DESTINATION bin)
314 # Need to build dali-shader-generator using the host compiler, not the android cross-compiler so
315 # that it can be run on the host machine
316 OPTION(ANDROID_HOST_COMPILER "Provide the host compiler used by Android (Mandatory)")
317 IF(${ANDROID_HOST_COMPILER} STREQUAL "OFF")
318 MESSAGE(FATAL_ERROR "-DANDROID_HOST_COMPILER=\"Compiler\" must be set")
321 ADD_CUSTOM_COMMAND(OUTPUT ${SHADER_GENERATOR_NAME}
322 COMMAND ${ANDROID_HOST_COMPILER} -o ${CMAKE_CURRENT_BINARY_DIR}/${SHADER_GENERATOR_NAME} -std=c++17 ${SHADER_GENERATOR_SOURCES})
323 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHADER_GENERATOR_NAME}
324 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
328 SET(BUILT_IN_SHADER_GEN_CPP "${GENERATED_SHADER_DIR}/generated/builtin-shader-gen.cpp")
329 ADD_CUSTOM_COMMAND(OUTPUT ${BUILT_IN_SHADER_GEN_CPP}
330 DEPENDS ${SHADER_GENERATOR_NAME}
331 COMMAND ${SHADER_GENERATOR_BINARY} ${SHADER_SOURCE_DIR} ${SHADER_GENERATED_DIR})
333 SET(SOURCES ${SOURCES} ${BUILT_IN_SHADER_GEN_CPP})
336 SET( DALICORE_LDFLAGS
337 "${DALICORE_LDFLAGS}"
338 dali2-core::dali2-core )
340 FIND_PACKAGE( curl REQUIRED )
341 FIND_LIBRARY( GETOPT_LIBRARY NAMES getopt )
342 FIND_LIBRARY( EXIF_LIBRARY NAMES libexif )
344 FIND_PACKAGE( png REQUIRED )
345 FIND_PACKAGE( gif REQUIRED )
346 FIND_PACKAGE( jpeg REQUIRED )
347 FIND_LIBRARY( TURBO_JPEG_LIBRARY NAMES turbojpeg )
349 FIND_PACKAGE( freetype REQUIRED )
350 FIND_PACKAGE( harfbuzz REQUIRED )
351 FIND_LIBRARY( FRIBIDI_LIBRARY NAMES fribidi )
353 FIND_PACKAGE( unofficial-angle REQUIRED )
356 FIND_PACKAGE( unofficial-fontconfig REQUIRED )
359 FIND_PACKAGE( unofficial-cairo REQUIRED )
360 FIND_PACKAGE( WebP REQUIRED )
362 SET( DALIADAPTOR_LDFLAGS
363 "${DALIADAPTOR_LDFLAGS}"
364 dali2-adaptor::dali2-adaptor )
368 FIND_PACKAGE( pthreads REQUIRED )
371 ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} )
372 TARGET_LINK_LIBRARIES( ${name}
374 ${DALIADAPTOR_LDFLAGS}
379 TARGET_LINK_LIBRARIES( ${name} log GLESv3 EGL)
382 SET_TARGET_PROPERTIES( ${name}
384 VERSION ${DALI_TOOLKIT_VERSION}
385 SOVERSION ${${name}_VERSION_MAJOR}
389 IF( INSTALL_CMAKE_MODULES )
391 SET( BIN_DIR "${BIN_DIR}/debug" )
392 SET( LIB_DIR "${LIB_DIR}/debug" )
395 # Install the library files.
396 INSTALL( TARGETS ${name}
397 EXPORT ${name}-targets
398 LIBRARY DESTINATION ${LIB_DIR}
399 ARCHIVE DESTINATION ${LIB_DIR}
400 RUNTIME DESTINATION ${BIN_DIR}
403 # Install the cmake modules.
405 EXPORT ${name}-targets
407 FILE ${name}-targets.cmake
408 DESTINATION share/${name}
411 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake "
412 include(CMakeFindDependencyMacro)
413 include(\${CMAKE_CURRENT_LIST_DIR}/${name}-targets.cmake)
415 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake DESTINATION share/${name})
417 # Install the pdb file.
418 IF( ENABLE_DEBUG AND WIN32 )
419 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/${name}.pdb DESTINATION ${BIN_DIR} )
422 # Install the library so file and symlinks
423 INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
426 # Install the pkg-config file
427 IF( ENABLE_PKG_CONFIGURE )
428 INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
432 MACRO( COPY_RESOURCES FILE_LIST SRC_RELATIVE_DIRECTORY DESTINATION EXPLICIT_DESTINATION )
433 FOREACH( PATTERN ${FILE_LIST} )
434 FILE(GLOB FILES ${PATTERN} )
435 FOREACH( FILE ${FILES} )
436 STRING(REPLACE ${SRC_RELATIVE_DIRECTORY} ${DESTINATION} NEWFILE ${FILE} )
437 GET_FILENAME_COMPONENT(NEWDIR ${NEWFILE} DIRECTORY)
438 IF( "${EXPLICIT_DESTINATION}" STREQUAL "" )
439 STRING( REPLACE "dali-toolkit" "toolkit" NEWDIR2 ${NEWDIR} )
440 INSTALL( FILES ${FILE} DESTINATION ${NEWDIR2} )
442 INSTALL( FILES ${FILE} DESTINATION ${DESTINATION}/${EXPLICIT_DESTINATION} )
448 # macro for installing headers by replacing prefix. (TODO, investigate
449 # if there is a CMAKE way of doing this automatically)
450 MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST STRIP_PREFIX REPLACE_PREFIX)
451 GET_FILENAME_COMPONENT( SPREFIX ${STRIP_PREFIX} ABSOLUTE )
452 FOREACH(HEADER ${${HEADER_LIST}})
453 STRING(REGEX MATCH "(.*)[/]" DIR ${HEADER})
454 STRING(REPLACE ${SPREFIX} ${REPLACE_PREFIX} NEWDIR ${DIR})
455 INSTALL(FILES ${HEADER} DESTINATION ${INCLUDE_DIR}/${NEWDIR})
457 ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
459 # Install headers using lists defined by ADD_SUBDIRECTORY
460 INSTALL_HEADERS_WITH_DIRECTORY(PUBLIC_API_HEADERS ${ROOT_SRC_DIR}/dali-toolkit "dali-toolkit")
461 INSTALL_HEADERS_WITH_DIRECTORY(DEVEL_API_HEADERS ${ROOT_SRC_DIR}/dali-toolkit "dali-toolkit")
462 INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${ROOT_SRC_DIR}/dali-toolkit "dali-toolkit")
463 INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dali-toolkit/doc" )
465 # Install dali-toolkit.h
466 INSTALL( FILES ${ROOT_SRC_DIR}/dali-toolkit/dali-toolkit.h DESTINATION ${INCLUDE_DIR}/dali-toolkit )
468 # package doxygen file (contains doxygen grouping information)
469 INSTALL( FILES ${package_doxy_files} DESTINATION ${INCLUDE_DIR}/dali-toolkit/doc )
471 # On some platforms we want to install the data files to different location compare to
472 # the data location used runtime. For example, on Android we want the toolkit library to load
473 # the files from /data/data/com.sec.dali_demo/files but to install the files into ${PREFIX}/files
474 # for SDK to pick them up for the archive.
475 IF( DEFINED ENV{DALI_DATA_RW_INSTALL_DIR} )
476 SET( dataReadWriteInstallDir $ENV{DALI_DATA_RW_INSTALL_DIR} )
478 SET( dataReadWriteInstallDir ${dataReadWriteDir} )
481 IF( DEFINED ENV{DALI_DATA_RO_INSTALL_DIR} )
482 SET( dataReadOnlyInstallDir $ENV{DALI_DATA_RO_INSTALL_DIR} )
484 SET( dataReadOnlyInstallDir ${dataReadOnlyDir} )
487 COPY_RESOURCES( "${dali_toolkit_style_files}" "${ROOT_SRC_DIR}" "${dataReadOnlyInstallDir}" "./toolkit/styles" )
488 COPY_RESOURCES( "${dali_toolkit_image_files}" "${ROOT_SRC_DIR}" "${dataReadOnlyInstallDir}" "./toolkit/images" )
489 COPY_RESOURCES( "${dali_toolkit_sound_files}" "${ROOT_SRC_DIR}" "${dataReadOnlyInstallDir}" "./toolkit/sounds" )
490 COPY_RESOURCES( "${dali_toolkit_style_images}" "${ROOT_SRC_DIR}" "${dataReadOnlyInstallDir}" "./toolkit/styles/images" )
492 # The DALI_TOOLKIT_PREFIX must be set if this CMakeLists.txt is executed
493 # from the top-level CMake script using ADD_SUBDIRECTORY() to avoid
494 # target names duplication with other DALi modules.
495 IF( ENABLE_COVERAGE )
496 FIND_PROGRAM( LCOV_BIN "lcov" )
499 # Define custom rules for coverage
500 SET(COVERAGE_DIR .cov)
501 SET(COVERAGE_OUTPUT_DIR doc/coverage)
503 # lcov prior to 1.10 doesn't have -rc option; this and subsequent version don't output
504 # branch coverage. Determine the lcov version, and enable branch coverage accordingly.
505 EXECUTE_PROCESS( COMMAND bash -c "${LCOV_BIN} --version | cut -d' ' -f4" OUTPUT_VARIABLE LCOV_VERSION )
506 STRING( REPLACE "." ";" LCOV_VLIST ${LCOV_VERSION})
507 IF( NOT $<VERSION_LESS:${LCOV_VERSION},"1.10"> )
508 SET(LCOV_OPTS --rc lcov_branch_coverage=1)
511 ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}rename_cov_data ./rename-cov-data )
513 ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}cov_data ${LCOV_BIN} ${LCOV_OPTS} --base-directory . --directory . -c -o dali.info
514 COMMAND ${LCOV_BIN} ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" \"*/dali-env/*\" \"*solid-color-actor*\" \"*/dali-toolkit/third-party/*\" \"*/dali-scene-loader/third-party/*\" -o dali.info )
516 ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}coverage genhtml -p ${ROOT_SRC_DIR} ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
519 ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}reset_coverage @${LCOV_BIN} -z --directory `pwd` )
521 # Define custom rule for distclean
522 ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}distclean @echo cleaning for source distribution )
524 DEPENDS ${DALI_TOOLKIT_PREFIX}clean
525 COMMENT "distribution clean"
528 -not -name config.cmake -and \(
533 -name cmake.depends -or
534 -name cmake.check_depends -or
535 -name CMakeCache.txt -or
536 -name cmake.check_cache -or
542 -name install_manifest.txt -or
548 -name libdali*.so* \)
549 | grep -v TC | xargs rm -rf
550 TARGET ${DALI_TOOLKIT_PREFIX}distclean
557 IF ( BUILD_SCENE_LOADER )
558 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/dali-scene-loader )
562 # Build documentation if doxygen tool is available
563 SET( doxygenEnabled OFF )
565 SET( doxygenEnabled ON )
566 # 'prefix' is used by doxygen in-files.
567 SET( prefix ${PREFIX} )
568 SET( DOXYGEN_DOCS_DIR ${ROOT_SRC_DIR}/docs )
569 SET( DOXYGEN_ROOT_DIR ${ROOT_SRC_DIR} )
570 SET( DOXYGEN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs )
571 SET( DOXYGEN_INTERNAL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs-internal )
572 CONFIGURE_FILE( ${DOXYGEN_SRC_DIR}/dali.doxy.in ${DOXYGEN_SRC_DIR}/dali.doxy @ONLY )
573 CONFIGURE_FILE( ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy.in ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy @ONLY )
575 IF ( BUILD_SCENE_LOADER )
576 ADD_CUSTOM_TARGET( doc_doxygen ALL
577 DEPENDS ${name} dali2-scene-loader
578 COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
579 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
580 COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
581 COMMENT "Generating API documentation with Doxygen"
582 WORKING_DIRECTORY ${DOXYGEN_SRC_DIR}
585 ADD_CUSTOM_TARGET( doc_doxygen ALL
587 COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
588 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
589 COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
590 COMMENT "Generating API documentation with Doxygen"
591 WORKING_DIRECTORY ${DOXYGEN_SRC_DIR}
595 # Following target is optional - it doesn't run by default
596 # Build using "make doc_doxygen_internal".
597 ADD_CUSTOM_TARGET( doc_doxygen_internal
598 COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy
599 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy
600 COMMENT "Generating Internal API documentation with Doxygen"
605 IF( CONFIGURE_AUTOMATED_TESTS )
606 # Configure automated tests
607 CONFIGURE_FILE( ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt.in
608 ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt @ONLY )
612 # Configuration Messages
613 MESSAGE( STATUS "Configuration:\n" )
614 MESSAGE( STATUS "Prefix: " ${PREFIX} )
615 MESSAGE( STATUS "Lib Dir: " ${LIB_DIR} )
616 MESSAGE( STATUS "Include Dir: " ${INCLUDE_DIR} )
617 MESSAGE( STATUS "Debug build: " ${ENABLE_DEBUG} )
618 MESSAGE( STATUS "Export all symbols: " ${ENABLE_EXPORTALL} )
619 MESSAGE( STATUS "Coverage: " ${ENABLE_COVERAGE} )
620 MESSAGE( STATUS "Trace: " ${ENABLE_TRACE} )
621 MESSAGE( STATUS "Doxygen: " ${doxygenEnabled} )
622 MESSAGE( STATUS "Data Dir (Read/Write): " ${dataReadWriteDir} )
623 MESSAGE( STATUS "Data Dir (Read Only): " ${dataReadOnlyDir} )
624 MESSAGE( STATUS "Data Install Dir (Read/Write): " ${dataReadWriteInstallDir} )
625 MESSAGE( STATUS "Data Install Dir (Read Only): " ${dataReadOnlyInstallDir} )
626 MESSAGE( STATUS "Style Dir: " ${STYLE_DIR} )
627 MESSAGE( STATUS "Style: " ${dali_style} )
628 MESSAGE( STATUS "i18n: " ${ENABLE_I18N} )
629 MESSAGE( STATUS "Use pkg configure: " ${ENABLE_PKG_CONFIGURE} )
630 MESSAGE( STATUS "Vector Based Text Rendering: " ${ENABLE_VECTOR_BASED_TEXT_RENDERING} )
631 MESSAGE( STATUS "Enable link test: " ${ENABLE_LINK_TEST} )
632 MESSAGE( STATUS "Configure automated tests: " ${CONFIGURE_AUTOMATED_TESTS} )
633 MESSAGE( STATUS "Build Dali Scene Loader: " ${BUILD_SCENE_LOADER} )
634 MESSAGE( STATUS "CXXFLAGS: " ${CMAKE_CXX_FLAGS} )
635 MESSAGE( STATUS "LDFLAGS: " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} )
637 MESSAGE( " Folder INSTALL_SHARE_DIR : [" ${INSTALL_SHARE_DIR} "]" )
638 MESSAGE( " Folder DALI_IMAGE_DIR : [" ${DALI_IMAGE_DIR} "]" )
639 MESSAGE( " Folder DALI_STYLE_DIR : [" ${DALI_STYLE_DIR} "]" )
640 MESSAGE( " Folder DALI_STYLE_IMAGE_DIR : [" ${DALI_STYLE_IMAGE_DIR} "]" )
641 MESSAGE( " Folder DALI_SOUND_DIR : [" ${DALI_SOUND_DIR} "]" )
642 MESSAGE( " Folder DALI_DATA_READ_ONLY_DIR : [" ${DALI_DATA_READ_ONLY_DIR} "]" )