@ -1,9 +1,22 @@
set_property ( GLOBAL PROPERTY FLUID_MODULES "" )
# f i n d a l l f l u i d m o d u l e s i s u s e d f o r p a d d l e f l u i d s t a t i c l i b r a r y
function ( find_fluid_modules TARGET_NAME )
get_filename_component ( __target_path ${ TARGET_NAME } ABSOLUTE )
string ( FIND "${__target_path}" "fluid" pos )
if ( pos GREATER 1 )
get_property ( fluid_modules GLOBAL PROPERTY FLUID_MODULES )
set ( fluid_modules ${ fluid_modules } ${ TARGET_NAME } )
set_property ( GLOBAL PROPERTY FLUID_MODULES "${fluid_modules}" )
endif ( )
endfunction ( find_fluid_modules )
# m a k e p a c k a g e f o r p a d d l e f l u i d s h a r e d a n d s t a t i c l i b r a r y
function ( copy TARGET )
set ( options "" )
set ( oneValueArgs "" )
set ( multiValueArgs SRCS DSTS DEPS )
cmake_parse_arguments ( copy_lib "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ ARGN } )
set ( inference_lib_dist_dep ${ TARGET } ${ inference_lib_dist_dep } PARENT_SCOPE )
list ( LENGTH copy_lib_SRCS copy_lib_SRCS_len )
list ( LENGTH copy_lib_DSTS copy_lib_DSTS_len )
@ -42,13 +55,21 @@ copy(glog_lib
D S T S $ { d s t _ d i r } $ { d s t _ d i r } / l i b
)
IF ( NOT PROTOBUF_FOUND )
if ( NOT PROTOBUF_FOUND )
set ( dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/protobuf" )
copy ( protobuf_lib
S R C S $ { P R O T O B U F _ I N C L U D E _ D I R } $ { P R O T O B U F _ L I TE _ L I BR A R Y }
S R C S $ { P R O T O B U F _ I N C L U D E _ D I R } $ { P R O T O B U F _ L I BR A R Y }
D S T S $ { d s t _ d i r } $ { d s t _ d i r } / l i b
)
ENDIF ( NOT PROTOBUF_FOUND )
endif ( )
if ( NOT CBLAS_FOUND )
set ( dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/openblas" )
copy ( openblas_lib
S R C S $ { C B L A S _ I N S T A L L _ D I R } / l i b $ { C B L A S _ I N S T A L L _ D I R } / i n c l u d e
D S T S $ { d s t _ d i r } $ { d s t _ d i r }
)
endif ( )
# p a d d l e f l u i d m o d u l e
set ( src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid" )
@ -66,8 +87,8 @@ copy(memory_lib
)
set ( module "inference" )
copy ( inference_lib DEP END S paddle_fluid_shared
S R C S $ { s r c _ d i r } / $ { m o d u l e } / * . h $ { P A D D L E _ B I N A R Y _ D I R } / p a d d l e / f l u i d / i n f e r e n c e / l i b p a d d l e _ f l u i d . so
copy ( inference_lib DEP S paddle_fluid_shared paddle_fluid
S R C S $ { s r c _ d i r } / $ { m o d u l e } / * . h $ { P A D D L E _ B I N A R Y _ D I R } / p a d d l e / f l u i d / i n f e r e n c e / l i b p a d d l e _ f l u i d . *
D S T S $ { d s t _ d i r } / $ { m o d u l e } $ { d s t _ d i r } / $ { m o d u l e }
)
@ -83,6 +104,4 @@ copy(string_lib
D S T S $ { d s t _ d i r } / $ { m o d u l e } $ { d s t _ d i r } / $ { m o d u l e } / t i n y f o r m a t
)
add_custom_target ( inference_lib_dist DEPENDS
i n f e r e n c e _ l i b f r a m e w o r k _ l i b m e m o r y _ l i b p l a t f o r m _ l i b s t r i n g _ l i b
g f l a g s _ l i b g l o g _ l i b p r o t o b u f _ l i b e i g e n 3 _ l i b )
add_custom_target ( inference_lib_dist DEPENDS ${ inference_lib_dist_dep } )