Commit 530f9cc0 authored by Vincent Wei's avatar Vincent Wei
Browse files

initial commit

parents
cmake_minimum_required(VERSION 2.6)
project(mGEff)
set(MGEFF_MAJOR_VERSION 1)
set(MGEFF_MINOR_VERSION 0)
set(MGEFF_MICRO_VERSION 0)
set(MGEFF_LIBNAME "mgeff")
SET (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/minigui/cmake/Modules)
include (common)
mg_declare_option_and_set_value (_ENABLE_SHARED enable_shared BOOL ON "whether output the shared lib")
mg_declare_option_and_set_value (_ENABLE_STATIC enable_static BOOL OFF "whether output the static lib")
option(ARCH_LEADCORE "Build mgeff for leadcore" OFF)
option(_MGEFF_EFFECTOR "Enable effector" ON)
if (_MGEFF_EFFECTOR)
option(_MGEFF_FASTMODE "Enable fastmode effector" ON)
option(HAVE_MESA_MINIGUI "Enable mesa-minigui support" OFF)
option(HAVE_EGL_SUPPORT "Enable egl support" OFF)
option(HAVE_GLES2_SUPPORT "Enable gles2 support" OFF)
option(_MGEFF_FIVEPOINTEDSTAREFFECTOR "Enable effector-five-pointed-start" ON)
option(_MGEFF_ROTATEEFFECTOR "Enable effector-rotate" ON)
option(_MGEFF_RADARSCANEFFECTOR "Enable effector-radar-scan" ON)
option(_MGEFF_CUBICROTATEEFFECTOR "Enable effector-cubic-rotate" ON)
option(_MGEFF_SCROLLEFFECTOR "Enable effector-scroll" ON)
option(_MGEFF_LEAFWINDOWEFFECTOR "Enable effector-leaf-window" ON)
option(_MGEFF_ZOOMEFFECTOR "Enable effector-zoom" ON)
option(_MGEFF_CENTERSPLITEFFECTOR "Enable effector-center-split" ON)
option(_MGEFF_FLIPEFFECTOR "Enable effector-flip" ON)
option(_MGEFF_ALPHAEFFECTOR "Enable effector-alpha" ON)
option(_MGEFF_ZIPEFFECTOR "Enable effector-zip" ON)
option(_MGEFF_CLEAREFFECTOR "Enable effector-clear" ON)
option(_MGEFF_PUSHEFFECTOR "Enable effector-push" ON)
option(_MGEFF_WINDOWANIMATION "Enable window animation support" ON)
endif (_MGEFF_EFFECTOR)
add_definitions(-D__MGEFF_LIB__)
INCLUDE (FindPkgConfig)
PKG_CHECK_MODULES (MINIGUI minigui)
IF (NOT MINIGUI_FOUND)
MESSAGE(FATAL_ERROR
"MiniGUI is not properly installed on the system. You need
MiniGUI Ver 3.0.x or later for building this package.
Please configure and install MiniGUI Ver 3.0.x first."
)
ENDIF (NOT MINIGUI_FOUND)
INCLUDE_DIRECTORIES (${MINIGUI_INCLUDE_DIRS})
LINK_DIRECTORIES (${MINIGUI_LIBRARY_DIRS})
LIST (APPEND PC_LIBS_LIST ${MINIGUI_LIBRARIES})
IF (_MGEFF_EFFECTOR)
PKG_CHECK_MODULES (MGPLUS mgplus)
IF (NOT MGPLUS_FOUND)
MESSAGE(FATAL_ERROR "mGPlus not found")
ENDIF (NOT MGPLUS_FOUND)
INCLUDE_DIRECTORIES (${MGPLUS_INCLUDE_DIRS})
LINK_DIRECTORIES (${MGPLUS_LIBRARY_DIRS})
LIST (APPEND PC_LIBS_LIST ${MGPLUS_LIBRARIES})
ENDIF (_MGEFF_EFFECTOR)
LIST (APPEND PC_LIBS_LIST ${MGEFF_LIBNAME})
set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix "\${prefix}")
set (libdir "\${exec_prefix}/lib")
set (includedir "\${prefix}/include")
set (MGEFF_VERSION ${MGEFF_MAJOR_VERSION}.${MGEFF_MINOR_VERSION}.${MGEFF_MICRO_VERSION})
FOREACH (l ${PC_LIBS_LIST})
SET (PC_LIBS "${PC_LIBS} -l${l}")
ENDFOREACH (l ${PC_LIBS_LIST})
configure_file(
"${PROJECT_SOURCE_DIR}/mgeff.pc.in"
"${PROJECT_BINARY_DIR}/mgeff.pc")
# pkgconfig
install (FILES "${PROJECT_BINARY_DIR}/mgeff.pc"
DESTINATION lib/pkgconfig)
configure_file (
"${PROJECT_SOURCE_DIR}/mgeffconfig.h.in"
"${PROJECT_BINARY_DIR}/mgeffconfig.h"
)
include_directories("${PROJECT_BINARY_DIR}")
if (ARCH_LEADCORE)
set (WIN32 OFF)
set (UNIX ON)
endif ()
add_subdirectory(src)
add_subdirectory(include)
#add_subdirectory(samples)
# Cmake Modules
install (DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/"
DESTINATION share/minigui/cmake/Modules
FILES_MATCHING PATTERN "*.cmake"
PATTERN "*private*" EXCLUDE
PATTERN ".svn" EXCLUDE
)
This diff is collapsed.
This diff is collapsed.
# mGEff
mGEff - An animation framework for MiniGUI.
This is mGEff v1.0 for MiniGUI Version 3.0.x or later.
mGEff is a component of MiniGUI, which provides an animation framework
on MiniGUI.
Copyright (C) 2002-2017, Beijing FMSoft Technologies Co., Ltd.
#
# Makefile: mGEff Daily build makefile
# Copyright (C) 2010 Feynman Software.
# Author: humingming
#
# get the inc files
INC_FILES=$(wildcard *.inc)
INC_TOTAL=$(words $(INC_FILES))
all:
@for inc in $(INC_FILES); do \
./build.sh $$inc; \
done; \
.PHONY: clean
clean:
-rm -rf $(FOLDER)
@echo "tmp file is clean."
#!/bin/bash
#
# build.sh: mGEff Daily build shell script
# Copyright (C) 2010 Feynman Software.
# Author: humingming
#
echo " "
# check Makefile give params
if [ $# -le 0 ]; then
echo "not enought param"
exit 1
else
INC_FILE=$1
echo $INC_FILE
fi
# check whether inc file exist
if [ ! -f $INC_FILE ]; then
echo "$INC_FILE does not exist!"
exit 1
fi
COMMON_CFG=common.cfg
# include the inc file
. ./$INC_FILE
. ./$COMMON_CFG
# export compile enviroment variables
echo "svn path is: $URI"
echo "configure is: $CONFIGURE_OPTS"
echo "MiniGUI cfg path is: $MG_CFG_PATH"
echo "MiniGUI res path is: $MG_RES_PATH"
echo "LD_LIBRARY_PATH is: $LD_LIBRARY_PATH"
echo "CFLAGS is: $CFLAGS"
echo "CPPFLAGS is: $CPPFLAGS"
echo "LDFLAGS is: $LDFLAGS"
echo " "
export MG_CFG_PATH
export MG_RES_PATH
export LD_LIBRARY_PATH
export CFLAGS
export CPPFLAGS
export LDFLAGS
# get report file path
FOLDER=${URI##*/}
BUILD_LOG=${INC_FILE/.inc/-compile.txt}
REAL_BLOG=../$BUILD_LOG
REAL_BLOG2=../../$BUILD_LOG
TEST_LOG=${INC_FILE/.inc/-gtest.txt}
REAL_TLOG=../../../$TEST_LOG
# get source from svn
rm -rf $FOLDER
echo "get source ... ..."
svn co $URI > $BUILD_LOG 2>&1
echo " "
echo " " >> $BUILD_LOG
echo " " >> $BUILD_LOG
# compile mgeff
echo "enter $FOLDER"
cd $FOLDER
svn info >> $REAL_BLOG 2>&1
echo " " >> $REAL_BLOG
./autogen.sh >> $REAL_BLOG 2>&1
./configure $CONFIGURE_OPTS >> $REAL_BLOG 2>&1
echo " " >> $REAL_BLOG
echo "make mgeff ... ..."
make install >> $REAL_BLOG 2>&1
echo "make mgeff complete " >> $REAL_BLOG
echo " " >> $REAL_BLOG
echo "make mgeff complete "
echo " "
# compile auto testcase
echo "enter testcase"
cd testcase
./autogen.sh >> $REAL_BLOG2 2>&1
./configure >> $REAL_BLOG2 2>&1
echo " " >> $REAL_BLOG2
echo "make testcase ... ..."
make >> $REAL_BLOG2 2>&1
echo "make testcase complete " >> $REAL_BLOG2
echo " " >> $REAL_BLOG2
echo "make testcase complete"
echo " "
# running auto testcase
echo " "
echo "enter auto"
cd auto
echo "running auto testcase ... ..."
if [ ! -f Makefile ]; then
echo "can not get auto testcase program list."
echo "$INC_FILE auto testcase not running."
else
# PROGRAMS=$(grep noinst_PROGRAMS Makefile.am)
# PROGRAMS=${PROGRAMS##*=}
# echo "total testcase is: $PROGRAMS"
# echo "begin $INC_FLIE testcase" > $REAL_TLOG
# echo " " >> $REAL_TLOG
# for program in $PROGRAMS
# do
# echo "running $program ... ..."
# echo "running $program ... ..." >> $REAL_TLOG
# ./$program >> $REAL_TLOG
# echo " " >> $REAL_TLOG
# done
echo "begin $INC_FLIE testcase" > $REAL_TLOG
make autotest >> $REAL_TLOG 2>&1
echo "$INC_FILE auto test complete"
echo " "
fi
CFLAGS="$CFLAGS -I${PREFIX}/include -O2 -Wall"
CPPFLAGS="$CPPFLAGS -I${PREFIX}/include -O2 -Wall"
LDFLAGS="$LDFLAGS -L${PREFIX}/lib"
# This is a sample inc file. if you don't want to run
# with this inc file. Please modify the ".inc" suffix
URI="svn+ssh://devsrv/home/projects/svn/mgeff/trunk"
PREFIX="$PWD/target"
CONFIGURE_OPTS="--prefix=${PREFIX} --enable-mgeffctrl=no"
MG_CFG_PATH="${PREFIX}/etc"
MG_RES_PATH="/usr/local/share/minigui/res"
LD_LIBRARY_PATH="${PREFIX}/lib"
# - This module determines the mgeff library of the system
# The following variables are set if the library found:
# MGEFF_FOUND - If false do nnt try to use mgeff.
# MGEFF_INCLUDE_DIR - where to find the headfile of library.
# MGEFF_LIBRARY_DIR - where to find the mgeff library.
# MGEFF_LIBRARY - the library needed to use mgeff.
# find the headfile of library
set (MGEFF_HEADS mgeff/mgeff.h)
find_path (MGEFF_INCLUDE_DIR ${MGEFF_HEADS})
set (MGEFF_NAMES mgeff libmgeff)
find_library (MGEFF_LIBRARY NAMES ${MGEFF_NAMES})
# just find one of dependency, guess other one.
if (NOT MGEFF_LIBRARY AND MGEFF_INCLUDE_DIR)
message ("We just find the headfile, try to guess the library location.")
set (MGEFF_LIBRARY_DIR "${MGEFF_INCLUDE_DIR}/../lib")
find_library (MGEFF_LIBRARY NAMES ${MGEFF_NAMES} PATHS ${MGEFF_LIBRARY_DIR})
elseif (NOT MGEFF_INCLUDE_DIR AND MGEFF_LIBRARY)
message ("We just find the lib file, try to guess the include location.")
string (REGEX REPLACE "[a-z|A-Z|0-9|_|-]+[.].*$" "" MGEFF_LIBRARY_DIR ${MGEFF_LIBRARY})
find_path (MGEFF_INCLUDE_DIR ${MGEFF_HEADS} "${MGEFF_LIBRARY_DIR}../included")
endif()
# find the library.
if (MGEFF_INCLUDE_DIR AND MGEFF_LIBRARY)
set (MGEFF_FOUND TRUE)
if (NOT MGEFF_LIBRARY_DIR)
string (REGEX REPLACE "[a-z|A-Z|0-9|_|-]+[.].*$" "" MGEFF_LIBRARY_DIR ${MGEFF_LIBRARY})
endif ()
string (REGEX MATCH "[a-z|A-Z|0-9|_|-]+[.](a|so|lib|dll|LIB|DLL)[^/]*$" MGEFF_LIBRARY_WHOLE_NAME "${MGEFF_LIBRARY}")
string (REGEX MATCH "[^(lib)][a-z|A-Z|0-9|_|-]+" MGEFF_LIBRARIES ${MGEFF_LIBRARY_WHOLE_NAME})
message (STATUS "Find MGEFF include in ${MGEFF_INCLUDE_DIR}")
message (STATUS "Find MGEFF library in ${MGEFF_LIBRARY}")
else ()
message (STATUS "Could NOT find MGEFF, (missing: MGEFF_INCLUDE_DIR MGEFF_LIBRARY)")
endif ()
#
macro (mg_sort_option_group _group)
foreach (i ${_group_${_group}})
set (_name ${_group}_${i})
# message (STATUS "_name=${_name} value of _name=${${_name}}")
list (APPEND _group_${_group}_${${_name}}_ ${i})
endforeach (i)
endmacro (mg_sort_option_group)
#
macro (mg_declare_option _option _type _default _description)
# message ("declare ${_option}")
if (${_type} STREQUAL "BOOL")
option (${_option} "${_description} <default=${_default}>" ${_default})
elseif (${_type} STREQUAL "STRING")
set (${_option} "${_default}" CACHE STRING "${_description} <default=${_default}>")
elseif (${_type} STREQUAL "PATH")
set (${_option} "${_default}" CACHE PATH "${_description} <default=${_default}>")
else ()
message (FATAL_ERROR "wrong type of declare_option: it should be BOOL, STRING, or PATH")
endif (${_type} STREQUAL "BOOL")
# put define in one of the output groud
string (REGEX MATCH "(.*)_(.*)" _not_used ${_option})
if (NOT CMAKE_MATCH_0)
message(FATAL_ERROR me=misc_havetracemsg
-- name=misc_havemsgstr
-- name=misc_havemenu
"bad option name: '${_option}'")
else ()
set (_group "_group_${CMAKE_MATCH_1}")
list (APPEND ${_group} ${CMAKE_MATCH_2})
endif (NOT CMAKE_MATCH_0)
endmacro (mg_declare_option)
#
macro (mg_set_variables_on)
foreach (_i ${ARGV})
set (${_i} ON)
endforeach (_i)
endmacro (mg_set_variables_on)
#
macro (mg_set_value _value _option)
#check option
set (_conditions_is_true TRUE)
string (REGEX MATCH "([^;]+).(.*)" _not_use "${ARGN}")
if (CMAKE_MATCH_0)
# message ("${CMAKE_MATCH_1} ${CMAKE_MATCH_2}")
if (CMAKE_MATCH_1 STREQUAL "IF")
if (${CMAKE_MATCH_2})
# message ("set TRUE " "${CMAKE_MATCH_2}")
else ()
set (_conditions_is_true FALSE)
# message ("set FALSE " "${CMAKE_MATCH_2}")
endif (${CMAKE_MATCH_2})
else ()
message (FATAL_ERROR "common.cmake:58 > wrong argument 3 in mg_set_value")
endif (CMAKE_MATCH_1 STREQUAL "IF")
endif (CMAKE_MATCH_0)
if (_conditions_is_true)
# set the _option of this _value
if (${_option} STREQUAL ON)
set (${_value} ON)
#message (STATUS "${_value} is ON")
elseif (${_option} STREQUAL OFF)
set (${_value} OFF)
#message (STATUS "${_value} is OFF")
else ()
set (${_value} ${_option})
#message (STATUS "${_value} is ${_option}")
endif (${_option} STREQUAL ON)
endif (_conditions_is_true)
endmacro (mg_set_value)
#
macro (mg_declare_option_and_set_value _value _option _type _default _description)
mg_declare_option (${_option} ${_type} ${_default} ${_description})
mg_set_value (${_value} ${_option})
endmacro (mg_declare_option_and_set_value)
#
macro (mg_declare_option_and_set_value_with_compile _code _value _option _type _default _description)
mg_declare_option (${_option} ${_type} ${_default} ${_description})
if (${_option})
include (CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES ("${_code}" _compile_ret)
if (_compile_ret)
mg_set_value (${_value} ON)
set (${_option} ON)
else ()
mg_set_value (${_value} OFF)
set (${_option} OFF)
endif(_compile_ret)
endif (${_option})
endmacro (mg_declare_option_and_set_value_with_compile)
#
macro (mg_set_number_select_value _value _option)
if (${ARGC} LESS 3)
message (FATAL_ERROR "no number list found for ${_option}")
else ()
set (${_value} ${ARGV2})
foreach (_i ${ARGN})
if (${_option} STREQUAL ${_i})
mg_set_value (${_value} ${_i})
break ()
endif (${_option} STREQUAL ${_i})
endforeach (_i ${ARGN})
endif (${ARGC} LESS 3)
endmacro (mg_set_number_select_value)
#
macro (mg_set_conditional _condition _option _value)
if (${_option} STREQUAL ${_value})
set (${_condition} ON)
# message (STATUS "conditional ${_condition} is set")
endif (${_option} STREQUAL ${_value})
endmacro (mg_set_conditional)
#print list
macro (mg_print_list)
set (_line " ")
if (${ARGC} GREATER 0)
foreach (_i ${ARGV})
string (LENGTH ${_line} _length)
if (_length GREATER 80)
message (${_line})
set (_line " ")
endif (_length GREATER 80)
set (_line "${_line} ${_i}")
endforeach (_i)
message (${_line})
else ()
message (${_line}(null))
endif (${ARGC} GREATER 0)
message ("")
endmacro (mg_print_list)
# macros to deal with source tree
macro(mg_add_sub_source_dirs)
set (_parent_source_list_ ${_source_list_})
foreach (_i ${ARGV})
set (_source_list_ "")
add_subdirectory (${_i})
if (_source_list_)
foreach (_file ${_source_list_})
list (APPEND _parent_source_list_ "${_i}/${_file}")
endforeach (_file)
endif (_source_list_)
endforeach (_i ${ARGV})
set (_source_list_ ${_parent_source_list_})
set (_source_list_ ${_source_list_} PARENT_SCOPE)
endmacro(mg_add_sub_source_dirs)
# add sub source dir with condition
macro(mg_add_sub_dir_with_condition _dir _condition)
if (${_condition})
mg_add_sub_source_dirs (${_dir})
endif (${_condition})
endmacro(mg_add_sub_dir_with_condition)
# add one file
macro(mg_add_source_files)
list (APPEND _source_list_ ${ARGV})
endmacro(mg_add_source_files)
# add all files
macro(mg_add_all_source_files)
set (_source_postfix "*.[ch]" "*.cc" "*.hh" "*.[ch]pp" "*.[ch]xx")
# There are more than once 'file' command invoked because the
# globbing expressions are similar to regular expressions,
# but much simpler, so it can't supports compound regex sentence.
set (_file_list "")
foreach (_postfix ${_source_postfix})
file (GLOB _file_list_sub_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_postfix})
list (APPEND _file_list ${_file_list_sub_})
endforeach (_postfix)
#set (_source_list_ ${_file_list})
list (APPEND _source_list_ ${_file_list})
#message(STATUS " " ${CMAKE_CURRENT_SOURCE_DIR} " : "${_source_list_})
endmacro(mg_add_all_source_files)
#
macro(mg_commit_source_files)
set (_source_list_ ${_source_list_} PARENT_SCOPE)
endmacro(mg_commit_source_files)
file(GLOB mgeff_header_files "*.h" "${PROJECT_BINARY_DIR}/mgeffconfig.h")
install(FILES ${mgeff_header_files} DESTINATION include/mgeff)
This diff is collapsed.
/*!============================================================================
* \file mgeff-animationgroup.h
* \brief animation group headfile.
* \author DongKai
* \version 1.0
* \date 02/03/2010 05:22:39 PM
*
* Company: Beijing Feynman Software Technology Co., Ltd.
*/
#ifndef _MGEFF_ANIMATION_GROUP_H_
#define _MGEFF_ANIMATION_GROUP_H_
/**
* \fn MGEFF_EXPORT mGEffAnimationCreateGroup(enum EffAnimationType type)
* \brief Create mgeff animation group.
*
* This function Creates an animation group according to the \a type..
*
* \param type Animation group type. It can be the following values:
*
* -MGEFF_PARALLEL
* Parallel animation group: all animation in the group will run
* simultaneously.
*
* -MGEFF_SEQUENTIAL
* Sequential animation group: all animation in the group will run one
* after another as when they are added to this animation group.
*
* \return the handle to the newly created animation group.
*
* \sa mGEffAnimationCreateEx mGEffAnimationCreate.
*/
MGEFF_ANIMATION MGEFF_EXPORT mGEffAnimationCreateGroup(enum EffAnimationType type);
/**
* \fn void MGEFF_EXPORT mGEffAnimationAddToGroup(MGEFF_ANIMATION group,
* MGEFF_ANIMATION animation)
* \brief Adds an animation to an animation group.
*
* This function Adds an animation specified by \a animation to an existing
* animation group specified by \a group.
*
* \param group animation group to which new animation will be added.
* \param animation the animation to be added.
*
* \sa mGEffAnimationCreateGroup.
*/
void MGEFF_EXPORT mGEffAnimationAddToGroup(MGEFF_ANIMATION group,
MGEFF_ANIMATION animation);
#endif
/*!============================================================================
* \file mgeff-common.h
* \brief common macro and type define.
* \author WanZheng
* \version 1.0
* \date 02/03/2010 05:22:39 PM
*
* Company: Beijing Feynman Software Technology Co., Ltd.
*/
#ifndef _MGEFF_COMMON_H_
#define _MGEFF_COMMON_H_
#if !defined(__NODLL__) && (defined (WIN32) || defined (__NUCLEUS_MNT__))
# if defined(__MGEFF_LIB__)
# define MGEFF_EXPORT __declspec(dllexport)
# else
# define MGEFF_EXPORT __declspec(dllimport)
# endif
#else
# define MGEFF_EXPORT /**< define MGEFF_EXPORT to NULL */
#endif
#ifndef MGEFF_MAJOR_VERSION
# include "mgeffconfig.h"
# undef PACKAGE_BUGREPORT
# undef PACKAGE_NAME
# undef PACKAGE_STRING
# undef PACKAGE_TARNAME
# undef PACKAGE_VERSION
#endif
/** \brief type of MGEFF_BOOL */
typedef int MGEFF_BOOL;
/** \brief type of MGEFF_TRUE */
#define MGEFF_TRUE 1
/** \brief type of MGEFF_FALSE */
#define MGEFF_FALSE 0
/**
* MGEFF_DECLARE_HANDLE
*/
#ifdef MGEFF_FORWARD_COMPATIBLE