stuff-from-scratch/test/graphics/CMakeLists.txt

41 lines
1.1 KiB
CMake
Raw Normal View History

2023-01-24 08:57:16 +00:00
set(MODULE_NAME graphics)
2022-11-30 18:28:50 +00:00
set(PLATFORM_UNIT_TEST_FILES)
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL QUIET)
if (OpenGL_FOUND)
2023-01-24 08:57:16 +00:00
set(PLATFORM_UNIT_TEST_FILES
TestOpenGlRendering.cpp
)
2022-11-30 18:28:50 +00:00
endif()
2023-01-05 13:16:52 +00:00
if(WIN32)
2023-01-24 08:57:16 +00:00
list(APPEND PLATFORM_UNIT_TEST_FILES
TestD2DOffScreenRendering.cpp
)
set(UI_TEST_FILES
TestDirectXRendering.cpp
TestD2DRendering.cpp
)
2023-01-05 13:16:52 +00:00
endif()
2023-01-24 08:57:16 +00:00
set(UNIT_TEST_FILES
TestRasterizer.cpp
${PLATFORM_UNIT_TEST_FILES}
2023-01-24 08:57:16 +00:00
)
set(UNIT_TEST_TARGET_NAME ${MODULE_NAME}_unit_tests)
add_executable(${UNIT_TEST_TARGET_NAME} ${CMAKE_SOURCE_DIR}/test/test_runner.cpp ${UNIT_TEST_FILES})
target_link_libraries(${UNIT_TEST_TARGET_NAME} PUBLIC test_utils graphics client)
set_property(TARGET ${UNIT_TEST_TARGET_NAME} PROPERTY FOLDER test/${MODULE_NAME})
set(UI_TEST_TARGET_NAME ${MODULE_NAME}_ui_tests)
add_executable(${UI_TEST_TARGET_NAME} WIN32 ${CMAKE_SOURCE_DIR}/test/ui_test_runner.cpp ${UI_TEST_FILES})
target_link_libraries(${UI_TEST_TARGET_NAME} PUBLIC test_utils graphics client)
set_property(TARGET ${UI_TEST_TARGET_NAME} PROPERTY FOLDER test/${MODULE_NAME})