From: 박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 Date: Thu, 26 Apr 2018 06:45:26 +0000 (+0900) Subject: Add 'TensorFlowSource' as an external module (#155) X-Git-Tag: nncc_backup~2731 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6a2be777f7aa9bd752556da9ece6a54a49bca97;p=platform%2Fcore%2Fml%2Fnnfw.git Add 'TensorFlowSource' as an external module (#155) This commit adds 'TensorFlowSource' as an external module. Any components in nncc are now able to download TensorFlowSource (if DOWNLOAD_TENSORFLOW is set as true) and access it through nncc_find_package macro. Signed-off-by: Jonghyun Park --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 29390c9..190987e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ endmacro(nncc_find_package) ### ### Configuration ### +option(DOWNLOAD_TENSORFLOW "Download TensorFlow source" OFF) + option(BUILD_GTEST "Download and build Google Test" ON) nncc_find_package(GTest QUIET) diff --git a/cmake/packages/TensorFlowSourceConfig.cmake b/cmake/packages/TensorFlowSourceConfig.cmake new file mode 100644 index 0000000..f08e23d --- /dev/null +++ b/cmake/packages/TensorFlowSourceConfig.cmake @@ -0,0 +1,18 @@ +function(_TensorFlowSource_import) + if(NOT DOWNLOAD_TENSORFLOW) + set(TensorFlowSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_TENSORFLOW) + + nncc_find_package(ExternalSourceTools REQUIRED) + nncc_find_package(OptionTools REQUIRED) + + envoption(TENSORFLOW_URL https://github.com/tensorflow/tensorflow/archive/v1.7.0.tar.gz) + + ExternalSource_Download(TENSORFLOW ${TENSORFLOW_URL}) + + set(TensorFlowSource_DIR ${TENSORFLOW_SOURCE_DIR} PARENT_SCOPE) + set(TensorFlowSource_FOUND TRUE PARENT_SCOPE) +endfunction(_TensorFlowSource_import) + +_TensorFlowSource_import()