dolphin/Source/UnitTests/CMakeLists.txt
JosJuice f695a65aad UnitTests: Delete output Sys folder before copying to it
Like the previous commit, but for UnitTests. This time all operating
systems were affected.

I also made UnitTests.vcxproj use the same way of copying as
DolphinQt.vcxproj, just for consistency.
2024-08-16 21:09:10 +02:00

26 lines
1014 B
CMake

enable_testing()
add_custom_target(unittests)
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} "--output-on-failure")
string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY "/Tests")
add_executable(tests EXCLUDE_FROM_ALL UnitTestsMain.cpp StubHost.cpp)
set_target_properties(tests PROPERTIES FOLDER Tests)
target_link_libraries(tests PRIVATE fmt::fmt gtest::gtest core uicommon)
add_test(NAME tests COMMAND tests)
add_custom_command(TARGET tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
)
add_dependencies(unittests tests)
macro(add_dolphin_test target)
add_library(${target} OBJECT ${ARGN})
target_link_libraries(${target} PUBLIC fmt::fmt gtest::gtest PRIVATE core uicommon)
target_link_libraries(tests PRIVATE ${target})
endmacro()
add_subdirectory(Common)
add_subdirectory(Core)
add_subdirectory(VideoCommon)