stuff-from-scratch/test/CMakeLists.txt
2022-10-09 17:39:46 +01:00

59 lines
1.8 KiB
CMake

add_library(test_utils STATIC
test_utils/TestCase.h
test_utils/TestCaseRunner.cpp
)
target_include_directories(test_utils PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/test_utils"
)
list(APPEND TestFiles
audio/TestAudioWriter.cpp
audio/TestMidiReader.cpp
core/TestBinaryStream.cpp
core/TestTomlReader.cpp
compiler/TestLexer.cpp
compression/TestStreamCompressor.cpp
database/TestDatabase.cpp
fonts/TestFontReader.cpp
graphics/TestOpenGlRendering.cpp
graphics/TestRasterizer.cpp
ipc/TestDbus.cpp
image/TestPngReader.cpp
image/TestPngWriter.cpp
network/TestNetworkManagerClient.cpp
network/TestNetworkManagerServer.cpp
publishing/TestPdfWriter.cpp
web/TestMarkdownParser.cpp
web/TestXmlParser.cpp)
if (${HAS_FFMPEG})
list(APPEND TestFiles
video/TestVideoDecoder.cpp
)
endif()
if (${HAS_WAYLAND})
list(APPEND TestFiles
windows/TestWaylandWindow.cpp
)
endif()
find_package(PkgConfig)
pkg_check_modules(DBUS dbus-1)
include_directories(${DBUS_INCLUDE_DIRS})
link_directories(${DBUS_LIBRARY_DIRS})
foreach(TestFile ${TestFiles})
cmake_path(GET TestFile FILENAME TestFileName)
cmake_path(GET TestFileName STEM TestName)
add_executable(${TestName} ${TestFile})
target_link_libraries(${TestName} PUBLIC core compression fonts network image publishing video database geometry audio graphics web client test_utils ${DBUS_LIBRARIES})
set_property(TARGET ${TestName} PROPERTY FOLDER test)
endforeach()
add_executable(test_runner test_runner.cpp)
target_link_libraries(test_runner PUBLIC core fonts network database geometry audio graphics web client)