1 SET(DEFAULT 0) 2 SET(DEPENDS 1) 3 4 SET(WEBKIT_FEATURES "") 5 6 SET(HTML_FEATURES "") 7 SET(SVG_FEATURES "") 8 9 MACRO(WEBKIT_SEPARATE_FEATURES _name _value) 10 FOREACH(f ${ARGN}) 11 LIST(APPEND ${f}_FEATURES "${_name}=${_value}") 12 ENDFOREACH() 13 ENDMACRO(WEBKIT_SEPARATE_FEATURES) 14 15 MACRO(WEBKIT_FEATURE_CHECK_DEPS _deps _deps_ok) 16 SET(${_deps_ok} TRUE) 17 18 LIST(LENGTH ${_deps} ${_deps_ok}_LIST_SIZE) 19 IF (${${_deps_ok}_LIST_SIZE} GREATER 1) 20 FOREACH(_dep ${${_deps}}) 21 IF (NOT ${_dep}) 22 SET(${_deps_ok} FALSE) 23 BREAK() 24 ENDIF () 25 ENDFOREACH () 26 ELSE () 27 IF (NOT ${_deps}) 28 SET(${_deps_ok} FALSE) 29 ENDIF () 30 ENDIF () 31 ENDMACRO() 32 33 MACRO(WEBKIT_FEATURE _feature _description _type _args) 34 IF (${_type} EQUAL ${DEPENDS}) 35 WEBKIT_FEATURE_CHECK_DEPS(${_args} DEPS_OK_${_feature}) 36 OPTION(${_feature} "${_description}" DEPS_OK_${_feature}) 37 ELSEIF (${_type} EQUAL ${DEFAULT}) 38 OPTION(${_feature} "${_description}" ${_args}) 39 ENDIF () 40 41 LIST(APPEND WEBKIT_FEATURES ${_feature}) 42 43 IF (${_feature}) 44 SET(${_feature}_VALUE 1) 45 WEBKIT_SEPARATE_FEATURES(${_feature} 1 ${ARGN}) 46 LIST(APPEND FEATURE_DEFINES ${_feature}) 47 ELSE () 48 SET(${_feature}_VALUE 0) 49 WEBKIT_SEPARATE_FEATURES(${_feature} 0 ${ARGN}) 50 ENDIF () 51 ENDMACRO() 52 53 MACRO(WEBKIT_PRINT_FEATURES) 54 MESSAGE(STATUS "Enabled features:") 55 56 SET(MAX_FEATURE_LENGTH 0) 57 FOREACH (_feature ${WEBKIT_FEATURES}) 58 STRING(LENGTH ${_feature} FEATURE_LENGTH) 59 IF (FEATURE_LENGTH GREATER MAX_FEATURE_LENGTH) 60 SET(MAX_FEATURE_LENGTH ${FEATURE_LENGTH}) 61 ENDIF () 62 ENDFOREACH () 63 64 SET(ODD 0) 65 FOREACH (_feature ${WEBKIT_FEATURES}) 66 STRING(LENGTH ${_feature} FEATURE_LENGTH) 67 SET(SPACES "") 68 69 IF (ODD) 70 FOREACH (IGNORE RANGE ${FEATURE_LENGTH} ${MAX_FEATURE_LENGTH}) 71 SET(SPACES "${SPACES} ") 72 ENDFOREACH () 73 SET(ODD 0) 74 ELSE () 75 FOREACH (IGNORE RANGE ${FEATURE_LENGTH} ${MAX_FEATURE_LENGTH}) 76 SET(SPACES "${SPACES}.") 77 ENDFOREACH () 78 SET(ODD 1) 79 ENDIF () 80 81 IF (${_feature}) 82 MESSAGE(STATUS " ${_feature} ${SPACES} ON") 83 ELSE () 84 MESSAGE(STATUS " ${_feature} ${SPACES} OFF") 85 ENDIF () 86 ENDFOREACH () 87 88 UNSET(FEATURE_LENGTH) 89 UNSET(MAX_FEATURE_LENGTH) 90 UNSET(ODD) 91 ENDMACRO() 92