1 # ----------------------------------------------------------------------------
2 # CMake file for cvtest. See root CMakeLists.txt
4 # ----------------------------------------------------------------------------
7 file(GLOB test_srcs "src/*.cpp")
8 source_group("Src" FILES ${test_srcs})
9 file(GLOB test_hdrs "src/*.h*")
10 source_group("Include" FILES ${test_hdrs})
12 include_directories("${CMAKE_SOURCE_DIR}/include/opencv"
13 "${CMAKE_CURRENT_SOURCE_DIR}/src"
14 "${CMAKE_CURRENT_BINARY_DIR}")
16 include_directories(../cxts)
18 set(the_target "cvtest")
20 add_executable(${the_target} ${test_srcs} ${test_hdrs})
23 set(pch_header ${CMAKE_SOURCE_DIR}/tests/cv/src/cvtest.h)
24 if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
25 if(${CMAKE_GENERATOR} MATCHES "Visual*")
26 set(${the_target}_pch "src/cvtest.cpp")
28 add_native_precompiled_header(${the_target} ${pch_header})
29 elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
30 add_precompiled_header(${the_target} ${pch_header})
34 # Additional target properties
35 set_target_properties(${the_target} PROPERTIES
36 DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
37 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
41 add_dependencies(${the_target} cxts cxcore cv cvaux highgui)
43 # Add the required libraries for linking:
44 target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} cxcore cv cvaux highgui cxts)
47 get_target_property(LOC ${the_target} LOCATION)
48 add_test(cvtest "${LOC}")
51 install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)