@ -50,7 +50,7 @@ macro( tde_install_icons )
set ( _icons "*" )
endif ( NOT _icons )
if ( NOT _dest )
set ( _dest "${ SHARE_INSTALL_DIR}/icons " )
set ( _dest "${ ICON_INSTALL_DIR} " )
endif ( NOT _dest )
foreach ( _icon ${ _icons } )
@ -179,6 +179,74 @@ libdir='${_destination}'
endmacro ( tde_install_la_file )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ a d d _ u i _ f i l e s
macro ( tde_add_ui_files _sources )
foreach ( _ui_file ${ ARGN } )
get_filename_component ( _ui_basename ${ _ui_file } NAME_WE )
get_filename_component ( _ui_absolute_path ${ _ui_file } ABSOLUTE )
list ( APPEND ${ _sources } ${ _ui_basename } .cpp )
add_custom_command ( OUTPUT ${ _ui_basename } .h ${ _ui_basename } .cpp
C O M M A N D $ { Q T _ U I C _ E X E C U T A B L E } $ { _ u i _ a b s o l u t e _ p a t h } - n o u n l o a d - o $ { _ u i _ b a s e n a m e } . h
C O M M A N D $ { Q T _ U I C _ E X E C U T A B L E } $ { _ u i _ a b s o l u t e _ p a t h } - n o u n l o a d - i m p l $ { _ u i _ b a s e n a m e } . h - o $ { _ u i _ b a s e n a m e } . c p p
C O M M A N D $ { Q T _ M O C _ E X E C U T A B L E } $ { _ u i _ b a s e n a m e } . h > > $ { _ u i _ b a s e n a m e } . c p p
D E P E N D S $ { _ u i _ a b s o l u t e _ p a t h } )
endforeach ( _ui_file )
endmacro ( tde_add_ui_files )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ a u t o m o c
macro ( tde_automoc )
foreach ( _src_file ${ ARGN } )
get_filename_component ( _src_file "${_src_file}" ABSOLUTE )
if ( EXISTS "${_src_file}" )
# r e a d s o u r c e f i l e a n d c h e c k i f h a v e m o c i n c l u d e
file ( READ "${_src_file}" _src_content )
string ( REGEX MATCHALL "#include +[^ ]+\\.moc[\" >] " _moc_includes " ${ _src_content } " )
# f o u n d i n c l u d e d moc ( s ) ?
if ( _moc_includes )
foreach ( _moc_file ${ _moc_includes } )
# e x t r a c t i n g m o c f i l e n a m e
string ( REGEX MATCH "[^ <\" ]+\\.moc " _moc_file " ${ _moc_file } " )
set ( _moc_file "${CMAKE_CURRENT_BINARY_DIR}/${_moc_file}" )
# c r e a t e h e a d e r f i l e n a m e
get_filename_component ( _src_path "${_src_file}" PATH )
get_filename_component ( _header_file "${_moc_file}" NAME_WE )
set ( _header_file "${_src_path}/${_header_file}.h" )
# m o c - i n g h e a d e r
add_custom_command ( OUTPUT ${ _moc_file }
C O M M A N D $ { T Q T _ T M O C _ E X E C U T A B L E } $ { _ h e a d e r _ f i l e } - o $ { _ m o c _ f i l e }
D E P E N D S $ { _ h e a d e r _ f i l e } )
# c r e a t e d e p e n d e n c y b e t w e e n s o u r c e f i l e a n d m o c f i l e
set_property ( SOURCE ${ _src_file } APPEND PROPERTY OBJECT_DEPENDS ${ _moc_file } )
endforeach ( _moc_file )
endif ( _moc_includes )
endif ( EXISTS "${_src_file}" )
endforeach ( _src_file )
endmacro ( tde_automoc )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # _ _ t d e _ i n t e r n a l _ p r o c e s s _ s o u r c e s
@ -199,7 +267,7 @@ macro( __tde_internal_process_sources _sources )
# h a n d l e . u i f i l e s
if ( ${ _ext } STREQUAL ".ui" )
kde3 _add_ui_files( ${ _sources } ${ _arg } )
tde _add_ui_files( ${ _sources } ${ _arg } )
# h a n d l e . s k e l f i l e s
elseif ( ${ _ext } STREQUAL ".skel" )
@ -368,8 +436,8 @@ macro( tde_add_library _arg_target )
# s t o r i n g v a l u e
if ( _storage AND NOT _skip_store )
# set ( ${ _storage } "${${_storage}} ${_arg}" )
list ( APPEND ${ _storage } ${ _arg } )
list ( REMOVE_DUPLICATES ${ _storage } )
endif ( _storage AND NOT _skip_store )
endforeach ( _arg )
@ -385,8 +453,14 @@ macro( tde_add_library _arg_target )
endif ( NOT _type )
# c h a n g e t a r g e t n a m e , b a s e d o n t y p e
string ( TOLOWER "${_type}" _target )
set ( _target "${_arg_target}-${_target}" )
string ( TOLOWER "${_type}" _type_lower )
set ( _target "${_arg_target}-${_type_lower}" )
# c r e a t e v a r i a b l e s l i k e " L I B _ x x x " f o r c o n v e n i e n c e
if ( ${ _type } STREQUAL "SHARED" )
string ( TOUPPER "${_arg_target}" _tmp )
set ( LIB_ ${ _tmp } ${ _target } CACHE INTERNAL LIB_ ${ tmp } FORCE )
endif ( ${ _type } STREQUAL "SHARED" )
# d i s a l l o w t a r g e t w i t h o u t s o u r c e s
if ( NOT _sources )
@ -398,7 +472,7 @@ macro( tde_add_library _arg_target )
# s e t a u t o m o c
if ( _automoc )
kde3 _automoc( ${ _sources } )
tde _automoc( ${ _sources } )
endif ( _automoc )
# a d d t a r g e t
@ -542,7 +616,7 @@ macro( tde_add_executable _arg_target )
# s e t a u t o m o c
if ( _automoc )
kde3 _automoc( ${ _sources } )
tde _automoc( ${ _sources } )
endif ( _automoc )
# a d d t a r g e t
@ -664,18 +738,18 @@ endmacro( tde_add_kdeinit_executable )
macro ( tde_install_symlink _target _link )
# i f p a t h i s r e l a t i v e , w e m u s t t o p r e f i x i t w i t h C M A K E _ I N S T A L L _ P R E F I X
if ( IS_ABSOLUTE ${ _link } )
if ( IS_ABSOLUTE "${_link}" )
set ( _destination "${_link}" )
else ( IS_ABSOLUTE ${ _link } )
else ( IS_ABSOLUTE "${_link}" )
set ( _destination "${CMAKE_INSTALL_PREFIX}/${_link}" )
endif ( IS_ABSOLUTE ${ _link } )
endif ( IS_ABSOLUTE "${_link}" )
# p r e f i x w i t h D E S T D I R
set ( _destination "$ENV{DESTDIR}${_destination}" )
get_filename_component ( _path ${ _destination } PATH )
get_filename_component ( _path "${_destination}" PATH )
if ( NOT IS_DIRECTORY "${_path}" )
install ( CODE " execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${_path} )" )
install ( CODE " file( MAKE_DIRECTORY \"${ _path } \" ) " )
endif ( NOT IS_DIRECTORY "${_path}" )
install ( CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${_target} ${_destination} )" )
@ -690,15 +764,28 @@ endmacro( tde_install_symlink )
macro ( tde_install_empty_directory _path )
# i f p a t h i s r e l a t i v e , w e m u s t t o p r e f i x i t w i t h C M A K E _ I N S T A L L _ P R E F I X
if ( IS_ABSOLUTE ${ _path } )
if ( IS_ABSOLUTE "${_path}" )
set ( _destination "${_path}" )
else ( IS_ABSOLUTE ${ _path } )
else ( IS_ABSOLUTE "${_path}" )
set ( _destination "${CMAKE_INSTALL_PREFIX}/${_path}" )
endif ( IS_ABSOLUTE ${ _path } )
endif ( IS_ABSOLUTE "${_path}" )
# p r e f i x w i t h D E S T D I R
set ( _destination "$ENV{DESTDIR}${_destination}" )
install ( CODE " execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${_destination} )" )
install ( CODE " file( MAKE_DIRECTORY \"${ _destination } \" ) " )
endmacro ( tde_install_empty_directory )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ c o n d i t i o n a l _ a d d _ s u b d i r e c t o r y
macro ( tde_conditional_add_subdirectory _cond _path )
if ( ${ _cond } )
add_subdirectory ( "${_path}" )
endif ( ${ _cond } )
endmacro ( tde_conditional_add_subdirectory )