Update to 2.0.0 tree from current Fremantle build
[opencv] / tests / ml / CMakeLists.txt
1 # ----------------------------------------------------------------------------
2 #  CMake file for cxcoretest. See root CMakeLists.txt
3 #
4 # ----------------------------------------------------------------------------
5 project(mltest)
6
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})
11
12 if(WIN32 AND MSVC)
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(
20                 ${src_file}
21                 PROPERTIES
22                 COMPILE_FLAGS "/Yc${pch_header}"
23                 )
24         else()
25             set_source_files_properties(
26                 ${src_file}
27                 PROPERTIES
28                 COMPILE_FLAGS "/Yu${pch_header}"
29                 )
30         endif()
31     endforeach()
32 endif()
33
34 include_directories(../cxts)
35
36 set(the_target "mltest")
37
38 add_executable(${the_target} ${test_srcs} ${test_hdrs})
39
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/"
44         )
45
46
47 add_dependencies(${the_target} cxts cxcore ml)
48
49 # Add the required libraries for linking:
50 target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} cxcore ml cxts)
51
52 enable_testing()
53 get_target_property(LOC ${the_target} LOCATION)
54 add_test(mltest "${LOC}")
55
56 if(WIN32)
57 install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
58 endif()