CMakeLists.txt 1.1 KB
Newer Older
D
dzhwinter 已提交
1
set(FLUID_CORE_MODULES proto_desc paddle_memory lod_tensor executor prune init)
2 3

cc_library(paddle_fluid_api
4
    SRCS io.cc
L
Luo Tao 已提交
5
    DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB})
6

L
Luo Tao 已提交
7 8 9 10
# Merge all modules into a single static library
cc_library(paddle_fluid DEPS paddle_fluid_api ${FLUID_CORE_MODULES} ${GLOB_OP_LIB})

# Create shared library
11
add_library(paddle_fluid_shared SHARED io.cc)
L
Luo Tao 已提交
12 13 14 15

target_circle_link_libraries(paddle_fluid_shared
  ARCHIVE_START
  ${GLOB_OP_LIB}
L
Luo Tao 已提交
16 17
  ${FLUID_CORE_MODULES}
  ARCHIVE_END)
18

19 20
SET_TARGET_PROPERTIES(paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid)

L
Luo Tao 已提交
21
# install library & headers
L
Luo Tao 已提交
22 23 24 25 26 27 28 29 30
set(lib_dir "${CMAKE_INSTALL_PREFIX}/paddle/inference")
add_custom_target(inference_lib DEPENDS paddle_fluid_shared
    COMMAND mkdir -p "${lib_dir}"
    COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${lib_dir}"
    COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/libpaddle_fluid.so" "${lib_dir}"
)
add_custom_target(inference_lib_dist DEPENDS 
  inference_lib framework_lib memory_lib platform_lib string_lib
  gflags_lib glog_lib protobuf_lib eigen3_lib)
L
Luo Tao 已提交
31

32 33
if(WITH_TESTING)
  add_subdirectory(tests/book)
34
endif()