2022-02-20 17:55:26 +01:00
|
|
|
project(
|
|
|
|
ScreenPlaySysInfo
|
|
|
|
VERSION 0.1
|
|
|
|
LANGUAGES CXX)
|
2020-04-30 20:03:14 +02:00
|
|
|
|
2021-01-28 15:19:46 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2022-02-20 17:55:26 +01:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2020-03-10 12:16:58 +01:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2020-04-30 20:03:14 +02:00
|
|
|
|
2021-05-12 17:09:24 +02:00
|
|
|
find_package(infoware CONFIG REQUIRED)
|
2021-06-20 18:50:54 +02:00
|
|
|
|
|
|
|
find_package(
|
2021-09-10 11:09:38 +02:00
|
|
|
Qt6
|
2020-10-29 18:53:52 +01:00
|
|
|
COMPONENTS Quick Core
|
|
|
|
REQUIRED)
|
2020-04-30 20:03:14 +02:00
|
|
|
|
2022-02-20 17:55:26 +01:00
|
|
|
# Because this is a plugin, we need this for testing and development. This can be disabled when using the plugin in your project directly.
|
|
|
|
option(tst_ScreenPlaySysInfo "Builds TextProject" ON)
|
|
|
|
|
|
|
|
set(QML # cmake-format: sortable
|
|
|
|
src/TestMain.qml)
|
|
|
|
|
|
|
|
set(QML_PLUGIN_SOURCES # cmake-format: sortable
|
2022-03-12 14:30:03 +01:00
|
|
|
src/sysinfo.cpp src/cpu.cpp src/ram.cpp src/storage.cpp src/uptime.cpp src/gpu.cpp src/ipaddress.cpp)
|
2022-02-20 17:55:26 +01:00
|
|
|
|
|
|
|
set(QML_PLUGIN_HEADER
|
2021-10-15 15:06:05 +02:00
|
|
|
# cmake-format: sortable
|
2022-02-20 17:55:26 +01:00
|
|
|
src/sysinfo.h
|
|
|
|
src/cpu.h
|
|
|
|
src/ram.h
|
|
|
|
src/mathhelper.h
|
|
|
|
src/storage.h
|
|
|
|
src/uptime.h
|
2022-03-12 14:30:03 +01:00
|
|
|
src/gpu.h
|
|
|
|
src/ipaddress.h)
|
2022-02-20 17:55:26 +01:00
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} STATIC)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick infoware)
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC src/)
|
2020-03-10 12:34:34 +01:00
|
|
|
|
2020-04-30 20:03:14 +02:00
|
|
|
|
2021-12-31 13:32:37 +01:00
|
|
|
qt_add_qml_module(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
URI
|
|
|
|
${PROJECT_NAME}
|
|
|
|
VERSION
|
2022-02-20 17:55:26 +01:00
|
|
|
1.0
|
|
|
|
OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}
|
|
|
|
QML_FILES
|
|
|
|
${QML}
|
|
|
|
SOURCES
|
|
|
|
${QML_PLUGIN_SOURCES}
|
|
|
|
${QML_PLUGIN_HEADER})
|
|
|
|
|
|
|
|
if(${tst_ScreenPlaySysInfo})
|
|
|
|
qt_add_executable(tst_ScreenPlaySysInfo src/TestMain.cpp)
|
|
|
|
target_link_libraries(tst_ScreenPlaySysInfo PRIVATE Qt6::Quick ${PROJECT_NAME}plugin)
|
|
|
|
target_compile_definitions(tst_ScreenPlaySysInfo PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
|
|
|
endif()
|