Attempted to fix issue with running tests on Windows.

This commit is contained in:
Nathan Osman
2015-07-18 23:36:25 -07:00
parent 3f51d915ad
commit 3bd3752530

View File

@@ -20,6 +20,14 @@ foreach(TEST ${TESTS})
target_link_libraries(${TEST} QHttpEngine common)
add_test(NAME ${TEST}
COMMAND ${TEST}
WORKING_DIRECTORY "$<TARGET_FILE_DIR:QHttpEngine>"
)
endforeach()
# On Windows, the library's DLL must exist in the same directory as the test
# executables which link against it - create a custom command to copy it
if(WIN32 NOT BUILD_STATIC)
add_custom_target(QHttpEngine-copy ALL
"${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:QHttpEngine>" "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS QHttpEngine
)
endif()