stuff-from-scratch/test/CMakeLists.txt

86 lines
2.4 KiB
CMake
Raw Normal View History

2021-10-31 13:04:48 +00:00
add_library(test_utils STATIC
2021-05-23 20:02:38 +00:00
test_utils/TestCase.h
test_utils/TestCaseRunner.cpp
)
target_include_directories(test_utils PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/test_utils"
)
2021-05-23 20:02:38 +00:00
list(APPEND TestFiles
audio/TestAudioWriter.cpp
2021-09-26 12:40:52 +00:00
audio/TestMidiReader.cpp
core/TestByteUtils.cpp
2022-07-31 19:01:13 +00:00
core/TestBinaryStream.cpp
2022-11-23 15:41:33 +00:00
core/TestBitStream.cpp
core/TestTomlReader.cpp
2022-11-24 09:05:39 +00:00
core/TestDataStructures.cpp
2022-08-22 16:11:00 +00:00
compiler/TestLexer.cpp
compiler/TestTemplatingEngine.cpp
2022-08-01 15:14:14 +00:00
compression/TestStreamCompressor.cpp
2022-11-28 10:16:04 +00:00
compression/TestHuffmanStream.cpp
2022-01-01 18:46:31 +00:00
database/TestDatabase.cpp
2022-07-31 19:01:13 +00:00
fonts/TestFontReader.cpp
2022-05-15 13:58:31 +00:00
graphics/TestRasterizer.cpp
2022-08-01 13:00:40 +00:00
image/TestPngReader.cpp
image/TestPngWriter.cpp
2022-05-18 07:42:44 +00:00
network/TestNetworkManagerClient.cpp
network/TestNetworkManagerServer.cpp
2022-10-03 06:45:10 +00:00
publishing/TestPdfWriter.cpp
web/TestMarkdownParser.cpp
2022-01-01 18:46:31 +00:00
web/TestXmlParser.cpp)
2022-10-03 06:45:10 +00:00
if (${HAS_FFMPEG})
list(APPEND TestFiles
video/TestVideoDecoder.cpp
2022-10-03 06:45:10 +00:00
)
endif()
if (${HAS_WAYLAND})
list(APPEND TestFiles
windows/TestWaylandWindow.cpp
)
endif()
2022-11-11 09:14:41 +00:00
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL QUIET)
if (OpenGL_FOUND)
list(APPEND TestFiles
graphics/TestOpenGlRendering.cpp
)
2022-10-03 06:45:10 +00:00
endif()
2022-01-01 18:46:31 +00:00
2022-01-01 18:46:31 +00:00
find_package(PkgConfig)
2022-08-17 08:04:52 +00:00
pkg_check_modules(DBUS dbus-1)
if (DBUS_FOUND)
include_directories(${DBUS_INCLUDE_DIRS})
link_directories(${DBUS_LIBRARY_DIRS})
list(APPEND TestFiles
ipc/TestDbus.cpp
)
endif()
2022-01-01 18:46:31 +00:00
2022-11-10 20:35:00 +00:00
if(UNIX)
find_package(Freetype QUIET)
if(Freetype_FOUND)
list(APPEND TestFiles
fonts/TestFreeTypeFontEngine.cpp
)
endif()
endif()
2022-08-28 13:55:22 +00:00
foreach(TestFile ${TestFiles})
cmake_path(GET TestFile FILENAME TestFileName)
cmake_path(GET TestFileName STEM TestName)
2021-10-31 13:04:48 +00:00
add_executable(${TestName} ${TestFile})
2022-08-28 13:57:54 +00:00
2022-10-12 08:01:19 +00:00
target_link_libraries(${TestName} PUBLIC core compiler compression fonts network image publishing video database geometry audio graphics web client test_utils ${DBUS_LIBRARIES})
2022-08-28 13:55:22 +00:00
set_property(TARGET ${TestName} PROPERTY FOLDER test)
2021-05-23 20:02:38 +00:00
endforeach()
add_executable(test_runner test_runner.cpp)
2022-08-01 13:00:40 +00:00
target_link_libraries(test_runner PUBLIC core fonts network database geometry audio graphics web client)