1 # ----------------------------------------------------------------------------
2 # CMake file for cxcoretest. 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})
13 set(pch_header "mltest.h")
14 set(pch_src "precomp.cpp")
15 list(REMOVE_ITEM test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/${pch_src})
16 set(test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/${pch_src} ${test_srcs})
17 foreach(src_file ${test_srcs})
18 if(${src_file} MATCHES ${pch_src})
19 set_source_files_properties(
22 COMPILE_FLAGS "/Yc${pch_header}"
25 set_source_files_properties(
28 COMPILE_FLAGS "/Yu${pch_header}"
34 include_directories(../cxts)
36 set(the_target "mltest")
38 add_executable(${the_target} ${test_srcs} ${test_hdrs})
40 # Additional target properties
41 set_target_properties(${the_target} PROPERTIES
42 DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
43 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
47 add_dependencies(${the_target} cxts cxcore ml)
49 # Add the required libraries for linking:
50 target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} cxcore ml cxts)
53 get_target_property(LOC ${the_target} LOCATION)
54 add_test(mltest "${LOC}")
57 install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)