CMakeLists.txt 881 字节
Newer Older
1 2 3
cmake_minimum_required(VERSION 3.0)

add_executable(main main.c)
4
add_dependencies(main paddle_pserver_cclient)
5 6
add_executable(test_cclient test_cclient.c)
add_dependencies(test_cclient paddle_pserver_cclient)
7 8 9

if(APPLE)
  set(CMAKE_EXE_LINKER_FLAGS "-framework CoreFoundation -framework Security")
10
else()
X
xuwei06 已提交
11
  set(CMAKE_EXE_LINKER_FLAGS "-pthread")
12
endif()
13 14

if(PROJ_ROOT)
X
xuwei06 已提交
15 16 17
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
  target_link_libraries(main ${CMAKE_CURRENT_BINARY_DIR}/../libpaddle_pserver_cclient.a pthread)
  target_link_libraries(test_cclient ${CMAKE_CURRENT_BINARY_DIR}/../libpaddle_pserver_cclient.a pthread)
18 19 20
else(PROJ_ROOT)
  include_directories(${CMAKE_BINARY_DIR})
  target_link_libraries(main ${CMAKE_BINARY_DIR}/libpaddle_pserver_cclient.a pthread)
21
  target_link_libraries(test_cclient ${CMAKE_BINARY_DIR}/libpaddle_pserver_cclient.a pthread)
22
endif(PROJ_ROOT)