CMakeLists.txt 1014 B

1234567891011121314151617181920212223242526
  1. enable_testing()
  2. add_custom_target(unittests)
  3. add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} "--output-on-failure")
  4. string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY "/Tests")
  5. add_executable(tests EXCLUDE_FROM_ALL UnitTestsMain.cpp StubHost.cpp)
  6. set_target_properties(tests PROPERTIES FOLDER Tests)
  7. target_link_libraries(tests PRIVATE fmt::fmt gtest::gtest core uicommon)
  8. add_test(NAME tests COMMAND tests)
  9. add_custom_command(TARGET tests POST_BUILD
  10. COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
  11. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
  12. )
  13. add_dependencies(unittests tests)
  14. macro(add_dolphin_test target)
  15. add_library(${target} OBJECT ${ARGN})
  16. target_link_libraries(${target} PUBLIC fmt::fmt gtest::gtest PRIVATE core uicommon)
  17. target_link_libraries(tests PRIVATE ${target})
  18. endmacro()
  19. add_subdirectory(Common)
  20. add_subdirectory(Core)
  21. add_subdirectory(VideoCommon)