From 0f9edddd92af74958d2e74d72a43ad48a45769a0 Mon Sep 17 00:00:00 2001 From: Ken Yu Date: Tue, 4 Apr 2017 13:54:09 +0800 Subject: [PATCH] Enable disabling test by option. --- CMakeLists.txt | 5 ++++- test/CMakeLists.txt | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43983f6..c3d9efb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 2.8.7) project(basic_pedestrian_tracker) -enable_testing() +option(test OFF) +if (test) + enable_testing() +endif () #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set (JAVA_HOME $ENV{JAVA_HOME} CACHE PATH "Home directory of Java Divelooment Toolkit (JDK).") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c4bab31..2dd1dc4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,10 +1,11 @@ +if (test) + add_executable(tracker_test tracker_test.cpp) + include_directories(tracker_test PUBLIC ${PROJECT_SOURCE_DIR}/include) + target_link_libraries(tracker_test basic_pedestrian_tracker opencv_core opencv_highgui opencv_imgproc) + add_test(NAME tracker_test COMMAND tracker_test ${TEST_VIDEO_PATH}) -add_executable(tracker_test EXCLUDE_FROM_ALL tracker_test.cpp) -include_directories(tracker_test PUBLIC ${PROJECT_SOURCE_DIR}/include) -target_link_libraries(tracker_test basic_pedestrian_tracker opencv_core opencv_highgui opencv_imgproc) -add_test(NAME tracker_test COMMAND tracker_test ${TEST_VIDEO_PATH}) - -add_executable(lib_test EXCLUDE_FROM_ALL lib_test.cpp) -include_directories(lib_test PUBLIC ${PROJECT_SOURCE_DIR}/include) -target_link_libraries(lib_test basic_pedestrian_tracker) -add_test(NAME lib_test COMMAND lib_test ../test_video/20131220184349-20131220184937.h264 ../conf/CAM01_0.conf) + add_executable(lib_test EXCLUDE_FROM_ALL lib_test.cpp) + include_directories(lib_test PUBLIC ${PROJECT_SOURCE_DIR}/include) + target_link_libraries(lib_test basic_pedestrian_tracker) + add_test(NAME lib_test COMMAND lib_test ../test_video/20131220184349-20131220184937.h264 ../conf/CAM01_0.conf) +endif ()