@ -1656,14 +1656,29 @@ endmacro( tde_add_tdeinit_executable )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ c o n d i t i o n a l _ a d d _ p r o j e c t _ t r a n s l a t i o n s
# # # # # t d e _ a d d _ p r o j e c t _ t r a n s l a t i o n s
# # # # #
# # # # # M a c r o f o r s t a n d a r d p r o c e s s i n g a n d i n s t a l l a t i o n o f t r a n s l a t i o n s .
# # # # # T h i s i s d e s i g n e d f o r o r d i n a r y m o d u l e s - a s a n a p p l i c a t i o n s , n o t f o r c o r e m o d u l e s .
function ( tde_conditional_add_project_translations _cond )
if ( ${ _cond } )
tde_add_project_translations ( )
endif ( )
endfunction ( )
function ( tde_add_project_translations )
file ( GLOB_RECURSE po_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } *.po )
if ( ${ CMAKE_CURRENT_SOURCE_DIR } STREQUAL ${ PROJECT_SOURCE_DIR } )
set ( TRANSLATIONS_SOURCE_DIR ${ PROJECT_SOURCE_DIR } /translations/messages )
else ( )
set ( TRANSLATIONS_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } )
endif ( )
file ( GLOB_RECURSE po_files RELATIVE ${ TRANSLATIONS_SOURCE_DIR } ${ TRANSLATIONS_SOURCE_DIR } /*.po )
string ( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
foreach ( _po ${ po_files } )
@ -1674,7 +1689,7 @@ function( tde_add_project_translations )
else ( )
set ( _component "${PROJECT_NAME}" )
endif ( )
tde_create_translation ( FILES ${ _po} LANG ${ _lang } OUTPUT_NAME ${ _component } )
tde_create_translation ( FILES ${ TRANSLATIONS_SOURCE_DIR} / ${ _po} LANG ${ _lang } OUTPUT_NAME ${ _component } )
endif ( )
endforeach ( )
@ -2101,14 +2116,29 @@ endmacro( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ c o n d i t i o n a l _ a d d _ p r o j e c t _ d o c s
# # # # # t d e _ a d d _ p r o j e c t _ d o c s
# # # # #
# # # # # M a c r o f o r s t a n d a r d p r o c e s s i n g a n d i n s t a l l a t i o n o f d o c u m e n t a t i o n a n d m a n p a g e s .
# # # # # T h i s i s d e s i g n e d f o r o r d i n a r y m o d u l e s - a s a n a p p l i c a t i o n s , n o t f o r c o r e m o d u l e s .
function ( tde_conditional_add_project_docs _cond )
if ( ${ _cond } )
tde_add_project_docs ( )
endif ( )
endfunction ( )
function ( tde_add_project_docs )
file ( GLOB_RECURSE _doc_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } * )
if ( ${ CMAKE_CURRENT_SOURCE_DIR } STREQUAL ${ PROJECT_SOURCE_DIR } )
set ( DOCS_SOURCE_DIR ${ PROJECT_SOURCE_DIR } /doc )
else ( )
set ( DOCS_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } )
endif ( )
file ( GLOB_RECURSE _doc_files RELATIVE ${ DOCS_SOURCE_DIR } ${ DOCS_SOURCE_DIR } /* )
foreach ( _doc_file IN LISTS _doc_files )
get_filename_component ( _dir ${ _doc_file } PATH )
list ( APPEND _dirs ${ _dir } )
@ -2123,15 +2153,15 @@ function( tde_add_project_docs )
unset ( _skip_subdir )
foreach ( _dir IN LISTS _dirs )
string ( REGEX REPLACE "/.*" "" _lang ${ _dir } )
if ( NOT ${ _lang } MATCHES "^(html|man|misc )$"
if ( NOT ${ _lang } MATCHES "^(html|man|misc |other )$"
AND ( NOT DEFINED _skip_subdir OR
N O T $ { _ d i r } M A T C H E S " ^ $ { _ s k i p _ s u b d i r } / " )
AND ( ${ _lang } STREQUAL "en" OR
" $ { _ l i n g u a s } " M A T C H E S " ^ ; * $ " O R
" ; $ { _ l i n g u a s } ; " M A T C H E S " ; $ { _ l a n g } ; " ) )
if ( EXISTS ${ CMAKE_CURRENT _SOURCE_DIR} / ${ _dir } /CMakeLists.txt )
if ( EXISTS ${ DOCS _SOURCE_DIR} / ${ _dir } /CMakeLists.txt )
set ( _skip_subdir ${ _dir } )
add_subdirectory ( ${ _dir} )
add_subdirectory ( ${ DOCS_SOURCE_DIR} / ${ _dir} )
else ( )
unset ( _skip_subdir )
if ( ${ _dir } MATCHES "/[^/]*/" )
@ -2139,7 +2169,7 @@ function( tde_add_project_docs )
else ( )
string ( REGEX REPLACE "^[^/]*/(.*)" "\\1" _doc_dest "${_dir}/${PROJECT_NAME}" )
endif ( )
file ( GLOB _doc_files RELATIVE ${ CMAKE_CURRENT _SOURCE_DIR} / ${ _dir } ${ _dir } /*.docbook )
file ( GLOB _doc_files RELATIVE ${ DOCS _SOURCE_DIR} / ${ _dir } ${ DOCS_SOURCE_DIR } / ${ _dir } /*.docbook )
if ( _doc_files )
list ( FIND _doc_files "index.docbook" _find_index )
if ( -1 EQUAL _find_index )
@ -2148,19 +2178,32 @@ function( tde_add_project_docs )
unset ( _noindex )
endif ( )
tde_create_handbook (
S O U R C E _ B A S E D I R $ { _d i r }
S O U R C E _ B A S E D I R $ { DO C S _ S O U R C E _ D I R } / $ { _d i r }
$ { _ n o i n d e x }
L A N G $ { _ l a n g }
D E S T I N A T I O N $ { _ d o c _ d e s t }
)
else ( )
file ( GLOB _html_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } ${ DOCS_SOURCE_DIR } / ${ _dir } /*.html )
if ( _html_files )
file ( GLOB _htmldoc_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR }
$ { D O C S _ S O U R C E _ D I R } / $ { _ d i r } / * . c s s
$ { D O C S _ S O U R C E _ D I R } / $ { _ d i r } / * . j p g
$ { D O C S _ S O U R C E _ D I R } / $ { _ d i r } / * . p n g
)
install (
F I L E S $ { _ h t m l _ f i l e s } $ { _ h t m l d o c _ f i l e s }
D E S T I N A T I O N $ { H T M L _ I N S T A L L _ D I R } / $ { _ l a n g } / $ { _ d o c _ d e s t }
)
endif ( )
endif ( )
endif ( )
endif ( )
endforeach ( )
if ( EXISTS ${ CMAKE_CURRENT_SOURCE_DIR } /man AND
N O T E X I S T S $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / m a n / C M a k e L i s t s . t x t )
file ( GLOB_RECURSE _man_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } man/* )
if ( EXISTS ${ DOCS _SOURCE_DIR} /man AND
N O T E X I S T S $ { DO C S _ S O U R C E _ D I R } / m a n / C M a k e L i s t s . t x t )
file ( GLOB_RECURSE _man_files RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } ${ DOCS_SOURCE_DIR } / man/* )
foreach ( _man_file IN LISTS _man_files )
if ( ${ _man_file } MATCHES "\\.[0-9]$" )
string ( REGEX REPLACE ".*\\.([0-9])$" "\\1" _man_section "${_man_file}" )
@ -2177,9 +2220,19 @@ function( tde_add_project_docs )
endforeach ( )
endif ( )
foreach ( _dir html man misc )
if ( EXISTS ${ CMAKE_CURRENT_SOURCE_DIR } / ${ _dir } /CMakeLists.txt )
add_subdirectory ( ${ _dir } )
if ( EXISTS ${ DOCS_SOURCE_DIR } /misc AND
N O T E X I S T S $ { D O C S _ S O U R C E _ D I R } / m i s c / C M a k e L i s t s . t x t )
install (
D I R E C T O R Y $ { D O C S _ S O U R C E _ D I R } / m i s c /
D E S T I N A T I O N $ { S H A R E _ I N S T A L L _ P R E F I X } / d o c / $ { P R O J E C T _ N A M E }
C O M P O N E N T d o c
P A T T E R N M a k e f i l e . a m E X C L U D E
)
endif ( )
foreach ( _dir html man misc other )
if ( EXISTS ${ DOCS_SOURCE_DIR } / ${ _dir } /CMakeLists.txt )
add_subdirectory ( ${ DOCS_SOURCE_DIR } / ${ _dir } )
endif ( )
endforeach ( )