Skip to content

Commit

Permalink
Enable disabling test by option.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu-sz committed Apr 4, 2017
1 parent a7170be commit 0f9eddd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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).")
Expand Down
19 changes: 10 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 ()

0 comments on commit 0f9eddd

Please sign in to comment.