@ -1957,12 +1957,20 @@ macro( tde_create_handbook )
unset ( _extra )
unset ( _srcdir )
get_filename_component ( _source_basedir "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE )
set ( _lang en )
set ( _first_arg 1 )
set ( _var _target )
foreach ( _arg ${ ARGN } )
# f o u n d d i r e c t i v e " S O U R C E _ B A S E D I R "
if ( "+${_arg}" STREQUAL "+SOURCE_BASEDIR" )
unset ( _source_basedir )
set ( _var _source_basedir )
set ( _directive 1 )
endif ( )
# f o u n d d i r e c t i v e " N O I N D E X "
if ( "+${_arg}" STREQUAL "+NOINDEX" )
set ( _noindex 1 )
@ -2019,6 +2027,16 @@ macro( tde_create_handbook )
endforeach ( )
# i f s o u r c e _ b a s e d i r i s r e l a t i v e , c o m p l e t e t h e p a t h t o a b s o l u t e
if ( NOT IS_ABSOLUTE ${ _source_basedir } )
get_filename_component ( _source_basedir "${_source_basedir}" ABSOLUTE )
endif ( )
# p r e p a r e t h e b i n a r y d i r e c t o r y a c c o r d i n g t o s o u r c e _ b a s e d i r
file ( RELATIVE_PATH _binary_basedir "${CMAKE_CURRENT_SOURCE_DIR}" "${_source_basedir}" )
set ( _binary_basedir "${CMAKE_CURRENT_BINARY_DIR}/${_binary_basedir}" )
file ( MAKE_DIRECTORY "${_binary_basedir}" )
# i f n o t a r g e t s p e c i f i e d , t r y t o g u e s s i t f r o m D E S T I N A T I O N
if ( NOT _target )
if ( NOT _dest )
@ -2029,9 +2047,24 @@ macro( tde_create_handbook )
set ( _target "${_target}-${_lang}-handbook" )
# i f s o u r c e s a r e l i s t e d , c o m p l e t e t h e p a t h t o a b s o l u t e
if ( _srcs )
foreach ( _src ${ _srcs } )
if ( NOT IS_ABSOLUTE ${ _src } )
list ( REMOVE_ITEM _srcs ${ _src } )
get_filename_component ( _src "${_source_basedir}/${_src}" ABSOLUTE )
list ( APPEND _srcs ${ _src } )
endif ( )
endforeach ( )
endif ( )
# i f n o f i l e s p e c i f i e d , i n c l u d e a l l d o c b o o k s , s t y l e s h e e t s a n d i m a g e s
if ( NOT _srcs )
file ( GLOB _srcs RELATIVE ${ CMAKE_CURRENT_SOURCE_DIR } *.docbook *.css *.png )
file ( GLOB _srcs
$ { _ s o u r c e _ b a s e d i r } / * . d o c b o o k
$ { _ s o u r c e _ b a s e d i r } / * . c s s
$ { _ s o u r c e _ b a s e d i r } / * . p n g
)
endif ( )
# i f n o d e s t i n a t i o n s p e c i f i e d , d e f a u l t i n g t o H T M L _ I N S T A L L _ D I R
@ -2050,7 +2083,7 @@ macro( tde_create_handbook )
if ( NOT _noindex )
# c h e c k f o r i n d e x . d o c b o o k
list ( FIND _srcs " index.docbook" _find_index )
list ( FIND _srcs " ${_source_basedir}/ index.docbook" _find_index )
if ( -1 EQUAL _find_index )
tde_message_fatal ( "missing index.docbook file" )
endif ( )
@ -2061,14 +2094,16 @@ macro( tde_create_handbook )
endif ( )
add_custom_command (
O U T P U T in d e x . c a c h e . b z 2
C O M M A N D $ { K D E 3 _ M E I N P R O C _ E X E C U T A B L E } $ { _ s r c d i r } - - c h e c k - - c a c h e i n d e x . c a c h e . b z 2 $ { CM A K E _ C U R R E N T _ S O U R C E _ D I R } / i n d e x . d o c b o o k
O U T P U T ${ _ b i n a r y _ b a s e d i r } / in d e x . c a c h e . b z 2
C O M M A N D $ { K D E 3 _ M E I N P R O C _ E X E C U T A B L E } $ { _ s r c d i r } - - c h e c k - - c a c h e i n d e x . c a c h e . b z 2 $ { _s o u r c e _ b a s e d i r } / i n d e x . d o c b o o k
C O M M E N T " G e n e r a t i n g $ { _ t a r g e t } "
D E P E N D S $ { _ s r c s } )
D E P E N D S $ { _ s r c s }
W O R K I N G _ D I R E C T O R Y " $ { _ b i n a r y _ b a s e d i r } "
)
add_custom_target ( ${ _target } ALL DEPENDS index.cache.bz2 )
add_custom_target ( ${ _target } ALL DEPENDS ${ _binary_basedir } / index.cache.bz2 )
list ( APPEND _srcs ${ CMAKE_CURRENT_BINARY_DIR } /index.cache.bz2 )
list ( APPEND _srcs ${ _binary_basedir } /index.cache.bz2 )
if ( NOT TDE_HTML_DIR )
set ( TDE_HTML_DIR ${ HTML_INSTALL_DIR } )