feat: prepared the cmake lists for qt dependencies
This commit is contained in:
parent
2d519937b7
commit
da875871ef
@ -8,14 +8,22 @@ project(azkoyen_ipc_test LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Qt Setup — AUTOMOC runs moc automatically on Q_OBJECT headers
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Test)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# Core library
|
||||
add_library(core
|
||||
src/core/SysfsRead.cxx
|
||||
src/core/UnixIpcBridge.cxx
|
||||
src/core/Producer.cxx
|
||||
src/core/Consumer.cxx
|
||||
include/Consumer.hpp
|
||||
)
|
||||
|
||||
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_link_libraries(core PUBLIC Qt5::Core)
|
||||
|
||||
#tests
|
||||
enable_testing()
|
||||
|
||||
@ -37,3 +37,19 @@ target_link_libraries(test_ipc
|
||||
)
|
||||
|
||||
add_test(NAME test_ipc COMMAND test_ipc)
|
||||
|
||||
|
||||
add_executable(test_consumer
|
||||
test_consumer.cxx
|
||||
)
|
||||
|
||||
target_link_libraries(test_consumer
|
||||
PRIVATE
|
||||
core
|
||||
gtest
|
||||
gtest_main
|
||||
Qt5::Core
|
||||
Qt5::Test
|
||||
)
|
||||
|
||||
add_test(NAME test_consumer COMMAND test_consumer)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user