diff --git a/cmake/generic.cmake b/cmake/generic.cmake index e4c1e2b41a1e69bd0b8015f8ca1b28b30072eaa2..90ec9532e5f3217501673e3471dd0f18708dff58 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -195,3 +195,10 @@ function(go_test TARGET_NAME) add_custom_target(${TARGET_NAME} ALL DEPENDS ${TARGET_NAME}_timestamp ${go_test_DEPS}) add_test(${TARGET_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}) endfunction(go_test) + +# go_extern will download extern go project. +# go_extern(target_name extern_source) +# go_extern(go_redis github.com/hoisie/redis) +function(go_extern TARGET_NAME) + add_custom_target(${TARGET_NAME} env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get ${ARGN}) +endfunction(go_extern)