CMakeLists.txt 979 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
if (WITH_DOUBLE)
  set(PADDLE_FLOAT_TYPE double)
else ()
  set(PADDLE_FLOAT_TYPE float)
endif()

configure_file(config.h.in config.h @ONLY)

set(CAPI_HEADER
   PaddleCAPI.h)
set(CAPI_PRIVATE_HEADER
   PaddleCAPIPrivate.h)
file(GLOB CAPI_SOURCES *.cpp)

add_library(paddle_capi SHARED ${CAPI_SOURCES})

target_include_directories(paddle_capi PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(paddle_capi gen_proto_cpp)

target_link_libraries(paddle_capi
Y
Stash  
Yu Yang 已提交
21
  "-Wl,-force_load"
Y
Yu Yang 已提交
22
  paddle_gserver
Y
Stash  
Yu Yang 已提交
23
  "-Wl,-force_load"
Y
Yu Yang 已提交
24 25 26 27 28 29 30 31 32 33 34
  paddle_function
  paddle_pserver
  paddle_trainer_lib
  paddle_network
  paddle_math
  paddle_utils
  paddle_parameter
  paddle_proto
  paddle_cuda
  ${PROTOBUF_LIBRARY}
  ${LIBGLOG_LIBRARY}
Y
Stash  
Yu Yang 已提交
35
  gflags
Y
Yu Yang 已提交
36 37 38 39
  ${CMAKE_THREAD_LIBS_INIT}
  ${CBLAS_LIBS}
  ${ZLIB_LIBRARIES}
  ${INTERAL_LIBS}
Y
Yu Yang 已提交
40 41
  ${CMAKE_DL_LIBS}
  ${PYTHON_LIBRARIES})
Y
Yu Yang 已提交
42 43 44 45 46 47 48 49

set(PADDLE_CAPI_INC_PATH
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR})

if (WITH_TESTING)
  add_subdirectory(tests)
endif()