CMakeLists.txt 653 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
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)

Y
Yu Yang 已提交
15
add_library(paddle_capi STATIC ${CAPI_SOURCES})
Y
Yu Yang 已提交
16 17

target_include_directories(paddle_capi PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
Y
Yu Yang 已提交
18 19
add_style_check_target(paddle_capi ${CAPI_SOURCES} ${CAPI_HEADER}
  ${CAPI_PRIVATE_HEADER})
Y
Yu Yang 已提交
20 21 22 23 24 25 26 27 28
add_dependencies(paddle_capi gen_proto_cpp)

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

if (WITH_TESTING)
  add_subdirectory(tests)
endif()