@ -4,26 +4,43 @@
# R e d i s t r i b u t i o n a n d u s e i s a l l o w e d a c c o r d i n g t o t h e t e r m s o f t h e B S D l i c e n s e .
# F o r d e t a i l s s e e t h e a c c o m p a n y i n g C O P Y I N G - C M A K E - S C R I P T S f i l e .
macro ( GNC_ADD_SWIG_COMMAND _target _output _input )
# g n c _ a d d _ s w i g _ g u i l e _ c o m m a n d i s u s e d t o g e n e r a t e g u i l e s w i g w r a p p e r s
# i t w i l l o n l y r e a l l y g e n e r a t e t h e w r a p p e r s w h e n b u i l d i n g f r o m g i t
# w h e n b u i l d i n g f r o m t a r b a l l i t w i l l s e t u p e v e r y t h i n g s o t h e v e r s i o n o f t h e w r a p p e r
# f r o m t h e t a r b a l l w i l l b e u s e d i n s t e a d
# - _ t a r g e t i s t h e n a m e o f a g l o b a l t a r g e t t h a t w i l l b e s e t f o r t h i s w r a p p e r f i l e ,
# t h i s c a n b e u s e d e l s e w h e r e t o c r e a t e a d e p e n c e n c y o n t h i s w r a p p e r
# - _ o u t _ v a r w i l l b e s e t t o t h e f u l l p a t h t o t h e g e n e r a t e d w r a p p e r f i l e
# w h e n b u i l d i n g f r o m g i t , i t p o i n t s t o t h e a c t u a l l y g e n e r a t e d f i l e
# h o w e v e r w h e n b u i l d i n g f r o m a t a r b a l l , i t w i l l p o i n t t o t h e v e r s i o n f r o m t h e t a r b a l l i n s t e a d
# - _ o u t p u t i s t h e n a m e o f t h e w r a p p e r f i l e t o generate ( or to look up in the tarball )
# - i n p u t i t t h e s w i g i n t e r f a c e file ( *.i ) t o g e n e r a t e t h i s w r a p p e r f r o m
# A n y a d d i t i o n a l p a r a m e t e r s w i l l b e u s e d a s d e p e n d e n c i e s f o r t h i s w r a p p e r t a r g e t
macro ( gnc_add_swig_guile_command _target _out_var _output _input )
add_custom_command (
O U T P U T $ { _ o u t p u t }
D E P E N D S $ { _ i n p u t } $ { C M A K E _ S O U R C E _ D I R } / c o m m o n / b a s e - t y p e m a p s . i $ { A R G N }
C O M M A N D $ { S W I G _ E X E C U T A B L E } - g u i l e $ { S W I G _ A R G S } - L i n k a g e m o d u l e - I $ { C M A K E _ S O U R C E _ D I R } / l i b g n u c a s h / e n g i n e - I $ { C M A K E _ S O U R C E _ D I R } / c o m m o n - o $ { _ o u t p u t } $ { _ i n p u t }
)
if ( BUILDING_FROM_VCS )
set ( SW_CURR_BUILD_SOURCE_DIR ${ CMAKE_CURRENT_BINARY_DIR } )
set ( SW_BUILD_SOURCE_DIR ${ CMAKE_BINARY_DIR } )
else ( )
set ( SW_CURR_BUILD_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } )
set ( SW_BUILD_SOURCE_DIR ${ CMAKE_SOURCE_DIR } )
endif ( )
add_custom_target ( ${ _target } DEPENDS ${ _output } )
set ( outfile ${ SW_CURR_BUILD_SOURCE_DIR } / ${ _output } )
set ( ${ _out_var } ${ outfile } ) # T h i s v a r i a b l e i s s e t f o r c o n v e n i e n c e t o u s e i n t h e c a l l i n g C M a k e L i s t s . t x t
if ( BUILDING_FROM_VCS )
set ( BUILD_SOURCE_DIR ${ CMAKE_CURRENT_BINARY_DIR } )
else ( )
set ( BUILD_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } )
add_custom_command (
O U T P U T $ { o u t f i l e }
D E P E N D S $ { _ i n p u t } $ { C M A K E _ S O U R C E _ D I R } / c o m m o n / b a s e - t y p e m a p s . i $ { A R G N }
C O M M A N D $ { S W I G _ E X E C U T A B L E } - g u i l e $ { S W I G _ A R G S } - L i n k a g e m o d u l e - I $ { C M A K E _ S O U R C E _ D I R } / l i b g n u c a s h / e n g i n e - I $ { C M A K E _ S O U R C E _ D I R } / c o m m o n - o $ { o u t f i l e } $ { _ i n p u t }
)
add_custom_target ( ${ _target } DEPENDS ${ outfile } )
endif ( )
# A d d t h e o u t p u t f i l e _ o u t p u t t o t h e d i s t t a r b a l l
file ( RELATIVE_PATH generated ${ BUILD_SOURCE_DIR } ${ _output } )
dist_add_generated ( ${ generated } )
endmacro ( GNC_ADD_SWIG_COMMAND )
# A d d t h e o u t p u t f i l e o u t f i l e t o t h e d i s t t a r b a l l
dist_add_generated ( ${ _output } )
endmacro ( gnc_add_swig_guile_command )
# g n c _ a d d _ s w i g _ p y t h o n _ c o m m a n d i s u s e d t o g e n e r a t e p y t h o n s w i g w r a p p e r s