diff --git a/core/cube/cube-transfer/CMakeLists.txt b/core/cube/cube-transfer/CMakeLists.txt index ab91c0f5f274d971d866ad33680a49103a641934..8db868b0a49aa3d53659c86091ad11b0d20f677b 100644 --- a/core/cube/cube-transfer/CMakeLists.txt +++ b/core/cube/cube-transfer/CMakeLists.txt @@ -18,9 +18,9 @@ project(cube-transfer Go) include(cmake/golang.cmake) -ExternalGoProject_Add(docopt-go github.com/docopt/docopt-go) ExternalGoProject_Add(rfw github.com/mipearson/rfw) -ExternalGoProject_Add(logex github.com/Badangel/logex) +ExternalGoProject_Add_With_Deps(docopt-go github.com/docopt/docopt-go github.com/mipearson/rfw) +ExternalGoProject_Add_With_Deps(logex github.com/Badangel/logex github.com/mipearson/rfw) add_subdirectory(src) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION ${PADDLE_SERVING_INSTALL_DIR}) diff --git a/core/cube/cube-transfer/cmake/golang.cmake b/core/cube/cube-transfer/cmake/golang.cmake index 817d029d946bad8da4f4cf2785e68d062fc4cada..c176bbd23d118e1425d00d9248cecc380ccc566e 100644 --- a/core/cube/cube-transfer/cmake/golang.cmake +++ b/core/cube/cube-transfer/cmake/golang.cmake @@ -19,6 +19,12 @@ function(ExternalGoProject_Add TARG) add_custom_target(${TARG} env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get ${ARGN}) endfunction(ExternalGoProject_Add) +function(ExternalGoProject_Add_With_Deps TARG DEPS) + add_custom_target(${TARG} + COMMAND env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get ${ARGN} + DEPENDS ${DEPS}) +endfunction(ExternalGoProject_Add_With_Deps) + function(add_go_executable NAME) file(GLOB GO_SOURCE RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.go") add_custom_command(OUTPUT ${OUTPUT_DIR}/.timestamp @@ -57,4 +63,4 @@ function(ADD_GO_LIBRARY NAME BUILD_TYPE) if(NOT BUILD_TYPE STREQUAL "STATIC") install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/bin) endif() -endfunction(ADD_GO_LIBRARY) \ No newline at end of file +endfunction(ADD_GO_LIBRARY)