# Define non-boolean options to CMake
SET(WITH_STYLE "480x800" CACHE STRING "Select the style folder to use")
+# from root/build/tizen, get back to root
+SET(ROOT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../)
+
+# Make sure the path is absolute
+GET_FILENAME_COMPONENT(ROOT_SRC_DIR ${ROOT_SRC_DIR} ABSOLUTE)
+
# Style folder
SET( STYLE_BASE_DIR ${ROOT_SRC_DIR}/dali-toolkit/styles )
SET( STYLE_DIR ${STYLE_BASE_DIR}/${dali_style} )
SET( toolkit_style_images_dir ${STYLE_DIR}/images )
IF( $ENV{DALI_DATA_RW_DIR} )
- SET( dataReadWriteDir ${DALI_DATA_RW_DIR}/ )
+ SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR}/ )
ELSE()
SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
ENDIF()
IF( $ENV{DALI_DATA_RO_DIR} )
- SET( dataReadOnlyDir ${DALI_DATA_RO_DIR}/ )
+ SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR}/ )
ELSE()
SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ )
ENDIF()
SET( PREFIX ${CMAKE_INSTALL_PREFIX})
SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
-# from root/build/tizen, get back to root
-SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
-
-# Make sure the path is absolute
-GET_FILENAME_COMPONENT(ROOT_SRC_DIR ${ROOT_SRC_DIR} ABSOLUTE)
-
# Set DALi style
SET( dali_style ${WITH_STYLE} )
INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
# Install the pkg-config file
-INSTALL( FILES ${CMAKE_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
# Glob for resources
MACRO( COPY_RESOURCES FILE_LIST SRC_RELATIVE_DIRECTORY DESTINATION EXPLICIT_DESTINATION )
COPY_RESOURCES( "${dali_toolkit_sound_files}" "${ROOT_SRC_DIR}" "${dataReadOnlyDir}" "./toolkit/sounds" )
COPY_RESOURCES( "${dali_toolkit_style_images}" "${ROOT_SRC_DIR}" "${dataReadOnlyDir}" "./toolkit/styles/images" )
+# The DALI_TOOLKIT_PREFIX must be set if this CMakeLists.txt is executed
+# from the top-level CMake script using ADD_SUBDIRECTORY() to avoid
+# target names duplication with other DALi modules.
IF( UNIX )
FIND_PROGRAM( LCOV_BIN "lcov" )
IF( LCOV_BIN )
SET(LCOV_OPTS --rc lcov_branch_coverage=1)
ENDIF()
- ADD_CUSTOM_TARGET( rename_cov_data ./rename-cov-data )
+ ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}rename_cov_data ./rename-cov-data )
- ADD_CUSTOM_TARGET( cov_data ${LCOV_BIN} ${LCOV_OPTS} --base-directory . --directory . -c -o dali.info
+ ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}cov_data ${LCOV_BIN} ${LCOV_OPTS} --base-directory . --directory . -c -o dali.info
COMMAND ${LCOV_BIN} ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" "*/dali-env/*" "*solid-color-actor*" "*/dali-toolkit/third-party/*" -o dali.info )
- ADD_CUSTOM_TARGET( coverage genhtml ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
+ ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}coverage genhtml ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
DEPENDS cov_data )
- ADD_CUSTOM_TARGET( reset_coverage @${LCOV_BIN} -z --directory `pwd` )
+ ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}reset_coverage @${LCOV_BIN} -z --directory `pwd` )
# Define custom rule for distclean
- ADD_CUSTOM_TARGET( distclean @echo cleaning for source distribution )
+ ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}distclean @echo cleaning for source distribution )
ADD_CUSTOM_COMMAND(
- DEPENDS clean
+ DEPENDS ${DALI_TOOLKIT_PREFIX}clean
COMMENT "distribution clean"
COMMAND find
ARGS .
-name *~ -or
-name libdali*.so* \)
| grep -v TC | xargs rm -rf
- TARGET distclean
+ TARGET ${DALI_TOOLKIT_PREFIX}distclean
VERBATIM
)