Skip to content

Commit

Permalink
fix: do not build tf unit tests when tf not requested in build
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz committed Dec 20, 2016
1 parent a504deb commit e9974b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ if (GTEST_FOUND)
COMMAND ut_httpapi
)

if (USE_TF)
set(INCEPT_EXAMPLE_PATH "examples/tf/inception/")
set(INCEPT_EXAMPLE_MODEL_OUT "inception_v1.pb")
set(INCEPT_IMG "grace_hopper.jpg")
Expand All @@ -139,14 +140,15 @@ if (GTEST_FOUND)
file(DOWNLOAD "http://www.deepdetect.com/models/tf/${INCEPT_IMG}" "${INCEPT_EXAMPLE_PATH}${INCEPT_IMG}")
file(DOWNLOAD "http://www.deepdetect.com/models/tf/${INCEPT_CORRESP}" "${INCEPT_EXAMPLE_PATH}${INCEPT_CORRESP}")
endif()

add_executable(ut_tfapi ut-tfapi.cc)
target_link_libraries(ut_tfapi ddetect ${CUDA_LIB_DEPS} glog gflags gtest gtest_main opencv_core opencv_highgui opencv_imgproc curlpp curl ${Boost_LIBRARIES} ${CAFFE_LIB_DEPS} ${TF_LIB_DEPS} ${XGBOOST_LIB_DEPS})
add_test(
NAME ut_tfapi
COMMAND ut_tfapi
)

endif()

if (USE_XGBOOST)
add_executable(ut_xgbapi ut-xgbapi.cc)
target_link_libraries(ut_xgbapi ddetect ${CUDA_LIB_DEPS} glog gflags gtest gtest_main ${OpenCV_LIBS} curlpp curl ${Boost_LIBRARIES} ${CAFFE_LIB_DEPS} ${XGBOOST_LIB_DEPS} ${TF_LIB_DEPS})
Expand Down

0 comments on commit e9974b8

Please sign in to comment.