Commit 6c437cce authored by Ethan Rublee's avatar Ethan Rublee

Placed the if in the wrong place.

parent 7e2221f3
...@@ -380,39 +380,38 @@ if(BUILD_TESTS) ...@@ -380,39 +380,38 @@ if(BUILD_TESTS)
add_executable(${the_target} ${test_srcs} ${test_hdrs}) add_executable(${the_target} ${test_srcs} ${test_hdrs})
endif(BUILD_TESTS) if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/test/test_precomp.hpp)
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS) if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/test/test_precomp.hpp) if(${CMAKE_GENERATOR} MATCHES "Visual*")
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*") set(${the_target}_pch "test/test_precomp.cpp")
if(${CMAKE_GENERATOR} MATCHES "Visual*") endif()
set(${the_target}_pch "test/test_precomp.cpp") add_native_precompiled_header(${the_target} ${pch_header})
endif() elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
add_native_precompiled_header(${the_target} ${pch_header}) add_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles") endif()
add_precompiled_header(${the_target} ${pch_header}) endif()
endif()
endif()
# Additional target properties # Additional target properties
set_target_properties(${the_target} PROPERTIES set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}" RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}"
) )
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "tests") set_target_properties(${the_target} PROPERTIES FOLDER "tests")
endif() endif()
add_dependencies(${the_target} ${test_deps}) add_dependencies(${the_target} ${test_deps})
# Add the required libraries for linking: # Add the required libraries for linking:
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${test_deps}) target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${test_deps})
enable_testing() enable_testing()
get_target_property(LOC ${the_target} LOCATION) get_target_property(LOC ${the_target} LOCATION)
add_test(${the_target} "${LOC}") add_test(${the_target} "${LOC}")
if(WIN32) if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main) install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
endif() endif()
endif(BUILD_TESTS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment