if (WITH_DOUBLE) set(PADDLE_FLOAT_TYPE double) else () set(PADDLE_FLOAT_TYPE float) endif() # config.h used for C-API. It will store Paddle building configuration as a # header. Make user just include PaddleCAPI.h then can get building # configuration without explicitly set -DPADDLE_WITH_DOUBLE when building their # libraries. configure_file(config.h.in config.h @ONLY) # PaddleCAPI.h is the only header we exposed. It currently only used for model # inference. set(CAPI_HEADER PaddleCAPI.h) set(CAPI_PRIVATE_HEADER PaddleCAPIPrivate.h) file(GLOB CAPI_SOURCES *.cpp) # building paddle_capi add_library(paddle_capi STATIC ${CAPI_SOURCES}) target_include_directories(paddle_capi PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) add_style_check_target(paddle_capi ${CAPI_SOURCES} ${CAPI_HEADER} ${CAPI_PRIVATE_HEADER}) add_dependencies(paddle_capi gen_proto_cpp) # combine all paddle static libraries together, into libpaddle_capi_whole.a # user should use PaddleCAPI as -lpaddle_capi_whole set(capi_whole_library libpaddle_capi_whole.a) add_custom_target(paddle_capi_whole ALL COMMAND mkdir -p o_files/capi && cd o_files/capi/ && ar -x $ COMMAND mkdir -p o_files/utils && cd o_files/utils/ && ar -x $ COMMAND mkdir -p o_files/parameter && cd o_files/parameter/ && ar -x $ COMMAND mkdir -p o_files/math && cd o_files/math/ && ar -x $ COMMAND mkdir -p o_files/cuda && cd o_files/cuda/ && ar -x $ COMMAND mkdir -p o_files/function && cd o_files/function/ && ar -x $ COMMAND mkdir -p o_files/gserver && cd o_files/gserver/ && ar -x $ COMMAND mkdir -p o_files/proto && cd o_files/proto/ && ar -x $ COMMAND mkdir -p o_files/network && cd o_files/network/ && ar -x +$ + COMMAND mkdir -p o_files/pserver && cd o_files/pserver/ && ar -x +$