|
Lines 29-66
endmacro( tde_message_fatal )
Link Here
|
| 29 |
|
29 |
|
| 30 |
################################################# |
30 |
################################################# |
| 31 |
##### |
31 |
##### |
|
|
32 |
##### tde_get_arg( <ARG_NAME> <COUNT> <RETURN> <REST> <ARGS...> ) |
| 33 |
##### ARG_NAME(string): name of an argument to find in ARGS |
| 34 |
##### COUNT(number): argument dimension, a number of items returned in RETURN |
| 35 |
##### RETURN(list ref): items returned for argument as they found in ARGS |
| 36 |
##### REST(list ref): rest of items except argument name and items returned in RETURN |
| 37 |
##### ARGS(list): source list of arguments |
| 38 |
|
| 39 |
macro( tde_get_arg ARG_NAME COUNT RETURN REST ) |
| 40 |
unset( ${RETURN} ) |
| 41 |
unset( ${REST} ) |
| 42 |
list( APPEND ${REST} ${ARGN} ) |
| 43 |
list( FIND ${REST} ${ARG_NAME} _arg_idx) |
| 44 |
if( NOT ${_arg_idx} EQUAL -1 ) |
| 45 |
list( APPEND ${REST} ___ensure_list___ ) |
| 46 |
list( REMOVE_AT ${REST} ${_arg_idx} ) |
| 47 |
list( REMOVE_ITEM ${REST} ___ensure_list___ ) |
| 48 |
set( _i 0 ) |
| 49 |
while( ${_i} LESS ${COUNT} ) |
| 50 |
list( GET ${REST} ${_arg_idx} _arg ) |
| 51 |
list( REMOVE_AT ${REST} ${_arg_idx} ) |
| 52 |
list( APPEND ${RETURN} ${_arg} ) |
| 53 |
math( EXPR _i "${_i} + 1" ) |
| 54 |
endwhile() |
| 55 |
endif() |
| 56 |
endmacro( tde_get_arg ) |
| 57 |
|
| 58 |
|
| 59 |
################################################ |
| 60 |
##### |
| 61 |
##### tde_execute_process( <ARGS...> [MESSAGE <MSG>] ) |
| 62 |
##### MSG: fatal error message (standard message will be written if not supplied) |
| 63 |
##### ARGS: execute_process arguments |
| 64 |
|
| 65 |
macro( tde_execute_process ) |
| 66 |
tde_get_arg( MESSAGE 1 _message _rest_args ${ARGV} ) |
| 67 |
tde_get_arg( RESULT_VARIABLE 1 _result_variable _tmp ${_rest_args} ) |
| 68 |
tde_get_arg( COMMAND 1 _command _tmp ${_rest_args} ) |
| 69 |
if( NOT DEFINED _result_variable ) |
| 70 |
list( APPEND _rest_args RESULT_VARIABLE _exec_result ) |
| 71 |
set( _result_variable _exec_result ) |
| 72 |
endif() |
| 73 |
execute_process( ${_rest_args} ) |
| 74 |
if( ${_result_variable} ) |
| 75 |
if( DEFINED _message ) |
| 76 |
message( FATAL_ERROR ${_message} ) |
| 77 |
else() |
| 78 |
if( ${${_result_variable}} MATCHES "^[0-9]+$" ) |
| 79 |
set( ${_result_variable} "status ${${_result_variable}} returned!" ) |
| 80 |
endif() |
| 81 |
message( FATAL_ERROR "Error executing '${_command}': ${${_result_variable}}" ) |
| 82 |
endif() |
| 83 |
endif() |
| 84 |
endmacro( tde_execute_process ) |
| 85 |
|
| 86 |
|
| 87 |
if( DEFINED MASTER_SOURCE_DIR ) |
| 88 |
return( ) |
| 89 |
endif( ) |
| 90 |
########### slave part ends here ############### |
| 91 |
|
| 92 |
|
| 93 |
################################################ |
| 94 |
##### |
| 32 |
##### tde_install_icons( <icons...> THEME <svgicons> DESTINATION <destdir> ) |
95 |
##### tde_install_icons( <icons...> THEME <svgicons> DESTINATION <destdir> ) |
| 33 |
##### default theme: hicolor |
96 |
##### default theme: hicolor |
| 34 |
##### default destination: ${SHARE_INSTALL_DIR}/icons |
97 |
##### default destination: ${SHARE_INSTALL_DIR}/icons |
| 35 |
|
98 |
|
| 36 |
macro( tde_install_icons ) |
99 |
macro( tde_install_icons ) |
| 37 |
|
100 |
tde_get_arg( DESTINATION 1 _dest _args ${ARGV} ) |
| 38 |
# clearing |
101 |
tde_get_arg( THEME 1 _req_theme _icons ${_args} ) |
| 39 |
unset( _dest ) |
|
|
| 40 |
unset( _req_theme ) |
| 41 |
unset( _icons ) |
| 42 |
set( _var _icons ) |
| 43 |
|
| 44 |
# parse all arguments |
| 45 |
foreach( _arg ${ARGV} ) |
| 46 |
# directive DESTINATION |
| 47 |
if( _arg STREQUAL "DESTINATION" ) |
| 48 |
set( _var _dest ) |
| 49 |
set( _directive 1 ) |
| 50 |
endif( _arg STREQUAL "DESTINATION" ) |
| 51 |
# directive THEME |
| 52 |
if( _arg STREQUAL "THEME" ) |
| 53 |
set( _var _req_theme ) |
| 54 |
set( _directive 1 ) |
| 55 |
endif( _arg STREQUAL "THEME" ) |
| 56 |
# collect data |
| 57 |
if( _directive ) |
| 58 |
unset( _directive ) |
| 59 |
else( _directive ) |
| 60 |
set( ${_var} ${${_var}} ${_arg} ) |
| 61 |
set( _var _icons ) |
| 62 |
endif( _directive ) |
| 63 |
endforeach( _arg ) |
| 64 |
|
102 |
|
| 65 |
#defaults |
103 |
#defaults |
| 66 |
if( NOT _icons ) |
104 |
if( NOT _icons ) |
|
Lines 232-237
macro( tde_add_ui_files _sources )
Link Here
|
| 232 |
-DUIC_EXECUTABLE:FILEPATH=${UIC_EXECUTABLE} |
270 |
-DUIC_EXECUTABLE:FILEPATH=${UIC_EXECUTABLE} |
| 233 |
-DTDE_QTPLUGINS_DIR:FILEPATH=${TDE_QTPLUGINS_DIR} |
271 |
-DTDE_QTPLUGINS_DIR:FILEPATH=${TDE_QTPLUGINS_DIR} |
| 234 |
-DUI_FILE:FILEPATH=${_ui_absolute_path} |
272 |
-DUI_FILE:FILEPATH=${_ui_absolute_path} |
|
|
273 |
-DMASTER_SOURCE_DIR:FILEPATH=${CMAKE_SOURCE_DIR} |
| 274 |
-DMASTER_BINARY_DIR:FILEPATH=${CMAKE_BINARY_DIR} |
| 235 |
-P ${CMAKE_MODULE_PATH}/tde_uic.cmake |
275 |
-P ${CMAKE_MODULE_PATH}/tde_uic.cmake |
| 236 |
COMMAND ${MOC_EXECUTABLE} ${_ui_basename}.h >> ${_ui_basename}.cpp |
276 |
COMMAND ${MOC_EXECUTABLE} ${_ui_basename}.h >> ${_ui_basename}.cpp |
| 237 |
DEPENDS ${_ui_absolute_path} ) |
277 |
DEPENDS ${_ui_absolute_path} ) |
|
Lines 702-708
endmacro( tde_add_kpart )
Link Here
|
| 702 |
##### |
742 |
##### |
| 703 |
##### tde_curdatetime |
743 |
##### tde_curdatetime |
| 704 |
macro( tde_curdatetime result ) |
744 |
macro( tde_curdatetime result ) |
| 705 |
execute_process( COMMAND "date" "+%m/%d/%Y %H:%M:%S" OUTPUT_VARIABLE ${result} ) |
745 |
tde_execute_process( COMMAND "date" "+%m/%d/%Y %H:%M:%S" OUTPUT_VARIABLE ${result} ) |
| 706 |
string( REGEX REPLACE "(..)/(..)/(....) (........).*" "\\1/\\2/\\3 \\4" ${result} ${${result}} ) |
746 |
string( REGEX REPLACE "(..)/(..)/(....) (........).*" "\\1/\\2/\\3 \\4" ${result} ${${result}} ) |
| 707 |
endmacro( tde_curdatetime ) |
747 |
endmacro( tde_curdatetime ) |
| 708 |
|
748 |
|