Cmake fails on inference_download_and_uncompress
Created by: ddokupil
**System information**
-PaddlePaddle version origin/develop eb05db71042565e45d5b3ddf5d5cb574dbaadba4
-CPU: including MKLDNN version
-OS Platform Ubuntu 16.04
-Python version 2.7
- Install method: build within custom docker
- Other special cases that you think may be related to this problem, eg. offline install, special internet condition
**To Reproduce**
Steps to reproduce the behavior
When trying cmake .. -DWITH_GPU=OFF -DWITH_MKLDNN=ON -DWITH_TESTING=ON -DWITH_PROFILER=ON -DWITH_INFERENCE_API_TEST=ON -DWITH_DISTRIBUTE=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DON_INFER=ON -DWITH_COVERAGE=ON -DWITH_NGRAPH=ON
We run into:
CMake Error at /usr/share/cmake-3.5/Modules/ExternalProject.cmake:2405 (add_custom_target):
add_custom_target cannot create target
"extern_inference_download_inference_vis_demos_2Fmobilenet_tar_gz" because
another target with the same name already exists. The existing target is a
custom target created in source directory
"/repos/paddle_paddle/paddle/fluid/inference/tests/api". See documentation
for policy CMP0002 for more details.
Call Stack (most recent call first):
paddle/fluid/inference/tests/test.cmake:30 (ExternalProject_Add)
paddle/fluid/inference/tests/api/CMakeLists.txt:301 (inference_download_and_uncompress)
As a workaround we comment out below in paddle/fluid/inference/tests/api/CMakeLists.txt
# mobilenet with transpose op
#set(MOBILENET_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/mobilenet")
#if (NOT EXISTS ${MOBILENET_INSTALL_DIR})
# inference_download_and_uncompress(${MOBILENET_INSTALL_DIR} "http://paddlemodels.bj.bcebos.com/" "inference-vis-demos%2Fmobilenet.tar.gz")
#endif()
#inference_analysis_api_test_with_refer_result(test_analyzer_mobilenet_transpose ${MOBILENET_INSTALL_DIR} analyzer_vis_tester.cc)