From: 박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 Date: Mon, 30 Apr 2018 07:44:24 +0000 (+0900) Subject: Add 'FarmhashSource' as an external module (#177) X-Git-Tag: nncc_backup~2728 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69ec9b2c24af6522fadc47bfda136d86d261c1ba;p=platform%2Fcore%2Fml%2Fnnfw.git Add 'FarmhashSource' as an external module (#177) This commit adds 'FarmhashSource' (which is necessary to build tensorflow lite) as an external module that nncc_find_package can load. Signed-off-by: Jonghyun Park --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d202e35..3addb55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ endmacro(nncc_find_package) ### Configuration ### option(DOWNLOAD_EIGEN "Download Eigen source" OFF) +option(DOWNLOAD_FARMHASH "Download farmhash source" OFF) option(DOWNLOAD_FLATBUFFERS "Download FlatBuffers source" OFF) option(DOWNLOAD_TENSORFLOW "Download TensorFlow source" OFF) diff --git a/cmake/packages/FarmhashSourceConfig.cmake b/cmake/packages/FarmhashSourceConfig.cmake new file mode 100644 index 0000000..4f5345b --- /dev/null +++ b/cmake/packages/FarmhashSourceConfig.cmake @@ -0,0 +1,19 @@ +function(_FarmhashSource_import) + if(NOT DOWNLOAD_FARMHASH) + set(FarmhashSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_FARMHASH) + + nncc_find_package(ExternalSourceTools REQUIRED) + nncc_find_package(OptionTools REQUIRED) + + # NOTE TensorFlow 1.7 downloads farmhash from the following URL + envoption(FARMHASH_URL https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz) + + ExternalSource_Download(FARMHASH ${FARMHASH_URL}) + + set(FarmhashSource_DIR ${FARMHASH_SOURCE_DIR} PARENT_SCOPE) + set(FarmhashSource_FOUND TRUE PARENT_SCOPE) +endfunction(_FarmhashSource_import) + +_FarmhashSource_import()